Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sunburst resets to root view on refresh #68

Open
allenday opened this issue Feb 17, 2019 · 2 comments
Open

sunburst resets to root view on refresh #68

allenday opened this issue Feb 17, 2019 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers tracked

Comments

@allenday
Copy link
Owner

if user is zoomed in when a refresh is triggered, chart refreshes but the zoom state is not preserved. can this be fixed?

@allenday allenday added enhancement New feature or request good first issue Good for newcomers labels Feb 17, 2019
@allenday
Copy link
Owner Author

@Firedrops want to take this one?

@Firedrops
Copy link
Contributor

Firedrops commented Feb 18, 2019

Seems feasible, but it will take a me a day or 2 to learn d3. Our visualizer also has a very different structure/script compared to other examples on bl.ocks, will need to wrap my head around this. If anyone else is keen on picking it up, I've found an example that might have implemented that functionality.

var node;
d3.json("/d/4063550/flare.json", function(error, root) {
  node = root;
  var path = svg.datum(root).selectAll("path")
      .data(partition.nodes)
    .enter().append("path")
      .attr("d", arc)
      .style("fill", function(d) { return color((d.children ? d : d.parent).name); })
      .on("click", click)
      .each(stash);
  d3.selectAll("input").on("change", function change() {
    var value = this.value === "count"
        ? function() { return 1; }
        : function(d) { return d.size; };
    path
        .data(partition.value(value).nodes)
      .transition()
        .duration(1000)
        .attrTween("d", arcTweenData);
  });
  function click(d) {
    node = d;
    path.transition()
      .duration(1000)
      .attrTween("d", arcTweenZoom(d));
  }
});
d3.select(self.frameElement).style("height", height + "px");

@obsh obsh added the tracked label Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers tracked
Projects
None yet
Development

No branches or pull requests

3 participants