Comments (2)
That worked!!! Thanks for taking the time to help me out!!
from d3plus-react.
thanks for the kind words @Zerok24!
Legend Styles
The legend is made using the Shape
class, the same as the shapes in the visualization (for both the little squares and the text labels). The legendConfig
method has a nested shapeConfig
object which gets passed to those shapes, and that nested object has it's own nested object for labelConfig
which is used to adjust the font styles of the label associated with the shape. It's a weird nesting doll situation, but we decided to go this way to give the most access possible. Here's an example of changing the size of the legend rectangles and the font styles:
legendConfig: {
shapeConfig: {
labelConfig: {
fontFamily: () => "'Source Sans Pro', sans-serif",
fontSize: () => 16,
fontWeight: () => 400
},
height: () => 10,
width: () => 15
}
}
All of the methods available in the shapeConfig
are listed here: https://github.com/d3plus/d3plus-shape#Shape
All of the methods available in the labelConfig
are listed here: https://github.com/d3plus/d3plus-text#TextBox
Tooltips
Tooltips have a similar config object, accessible via tootlipConfig
for the shapes in the visualization, and legendTooltip
for the tooltips used in the legend. Here's an example usage:
tooltipConfig: {
background: "white",
border: "1px solid #888",
footerStyle: {
"color": "#666",
"font-family": "'Palanquin', sans-serif",
"font-size": "12px",
"font-weight": "300",
"padding-top": "5px"
},
padding: "10px",
titleStyle: {
"font-family": "'Palanquin', sans-serif",
"font-size": "16px",
"font-weight": "300"
}
}
All of the available methods are listed here: https://github.com/d3plus/d3plus-tooltip#Tooltip
Additionally, since the tooltip is HTML (and not SVG), I sometimes do force overrides via CSS using the .d3plus-tooltip
class (and it's nested classes).
Hope that helps, let me know if you have any more question!
from d3plus-react.
Related Issues (20)
- hide tooltips associated with visualization when removing the visualization HOT 4
- Network error when using string value matching the id of the node in links HOT 3
- visualizations no longer setting default className to viz HOT 1
- Bubbles Drilldown? HOT 5
- How to change the color of the links in a network? HOT 2
- How to change the color of the links in a network? HOT 1
- export ColorScale and Legend classes HOT 1
- Active function in Network component HOT 1
- Tool Tips remain after GeoMap page is unloaded and browser displays another 'page'. HOT 2
- improve default base styles HOT 1
- .d3plus.js documentation in README out of date HOT 1
- Percentage on custom treemap label HOT 1
- bar charts axis starting at non-zero HOT 1
- create React wrappers for non-viz classes
- remove *Format functions after updating d3plus-viz
- update to use new React context HOT 6
- v.1.2.0 does not have required packages HOT 2
- Custom hover behavior HOT 4
- Custom events that change the colors on the map
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3plus-react.