Giter Club home page Giter Club logo

Comments (5)

SeloSlav avatar SeloSlav commented on June 25, 2024 1

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.

davelandry avatar davelandry commented on June 25, 2024

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.

SeloSlav avatar SeloSlav commented on June 25, 2024

I don't think it's a packing chart, though I could be wrong. Here is what my example looks like:

image

image

image

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.

SeloSlav avatar SeloSlav commented on June 25, 2024

I tried using the Pack component:

image

Result:

image

Is there something I am missing in terms of enabling drill-down via click?

Live View: http://seloslav.github.io/Coinmap

from d3plus-react.

davelandry avatar davelandry commented on June 25, 2024

Set .depth(0) to enable the click drilldowns.

from d3plus-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.