Comments (5)
For posterity. In the d3plus-react implementation, depth
is added as such:
const methods = {
depth: 0,
groupBy: ["parent", "group", "name"],
data: [
{name: "DASH", group: "Privacy Coins", parent: "Currency", value: 1},
{name: "BNT", group: "Stable Coins", parent: "Currency", value: 1},
{name: "SMART", group: "Privacy Coins", parent: "Currency", value: 1},
{name: "BTC", group: "Cryptocurrencies", parent: "Currency", value: 1},
{name: "BCH", group: "Cryptocurrencies", parent: "Currency", value: 1},
{name: "GNO", group: "Prediction", parent: "Communities", value: 1},
{name: "REP", group: "Prediction", parent: "Communities", value: 1}
],
size: d => d.value
};
class App extends Component {
render() {
return (
<div className="App">
<Pack config={methods} />
...
from d3plus-react.
The page you link to is only showing an underwater-esque background for me...
...but I'm assuming you're talking about a Pack chart? http://d3plus.org/examples/d3plus-hierarchy/pack/
All d3plus visualizations support nested drilldowns by default, here's the syntax: http://jsfiddle.net/ge5cjs6u/
Although now looking at it, there does appear to be a bug with the labels. I've filed that here: http://jsfiddle.net/ge5cjs6u/
from d3plus-react.
I don't think it's a packing chart, though I could be wrong. Here is what my example looks like:
var visualization = d3plus.viz()
.container("#svgbody1")
.data(sample_data)
.type("bubbles")
.id(["parent", "group", "name"])
.size("default")
.tooltip({
"html": htmlContent,
"sub": "description",
"anchor": "middle middle",
"fullscreen": true
})
.ui([
{
"method" : "size",
"type": "drop",
"value" : [{"# Coins": "default"}, {"Market Cap": "usd"}, {"Market Volume": "vol"}]
}
])
.format({
"text": function(text, params) {
if (text === "usd") {
return "Market Cap";
}
else if (text === "default") {
return "# Coins";
} else if (text === "vol") {
return "Volume";
} {
return d3plus.string.title(text, params);
}
},
"number": function(number, params) {
var formatted = d3plus.number.format(number, params);
if (params.key === "usd") {
return "$" + formatted + " USD";
} else if (params.key === "vol") {
return "$" + formatted + " USD";
}
else {
return formatted;
}
}
})
.draw()
from d3plus-react.
I tried using the Pack component:
Result:
Is there something I am missing in terms of enabling drill-down via click?
Live View: http://seloslav.github.io/Coinmap
from d3plus-react.
Set .depth(0)
to enable the click drilldowns.
from d3plus-react.
Related Issues (20)
- Issues in creating a grouped horizontal bar chart HOT 1
- 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
- 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
- Legend and Tooltip styling HOT 2
- v.1.2.0 does not have required packages HOT 2
- Custom hover behavior HOT 4
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.