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

TODO: what if the chart area changes #15

Open
pixelzoom opened this issue Dec 10, 2020 · 4 comments
Open

TODO: what if the chart area changes #15

pixelzoom opened this issue Dec 10, 2020 · 4 comments

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Dec 10, 2020

In DemoCanvasLinePlot.js and DemoLinePlot.js:

// TODO https://github.com/phetsims/bamboo/issues/15 what if the chart area changes, then clip needs to change
clipArea: chartRectangle.getShape(),
@pixelzoom pixelzoom self-assigned this Dec 10, 2020
pixelzoom added a commit that referenced this issue Dec 10, 2020
@pixelzoom
Copy link
Contributor Author

pixelzoom commented Dec 10, 2020

If the view dimensions of the ChartModel were to change, by using setWidth or setHeight, then you'd adjust the clipArea like this:

const clippedNode = new Node( {
   clipArea: chartRectangle.getShape(),
   ...
} );

chartRectangle.localBoundsProperty.lazyLink( localBounds => {
  clippedNode.clipArea = chartRectangle.getShape();
} );

That's pretty standard/straightforward, so I think we can simply delete these TODOs.

@samreid your thoughts?

@samreid
Copy link
Member

samreid commented Dec 11, 2020

The main question for me is if we should provide a bamboo type like ChartClipNode which automatically does that.

@samreid samreid assigned pixelzoom and unassigned samreid Dec 11, 2020
@pixelzoom
Copy link
Contributor Author

I can't recall implementing a sim chart whose view bounds change, so I doubt that ChartClipNode would get much use. But feel free to add it now if you'd like, or wait until it's needed. Up to you...

@pixelzoom pixelzoom assigned samreid and unassigned pixelzoom Dec 11, 2020
@samreid
Copy link
Member

samreid commented Dec 28, 2020

It seems most appropriate to develop this in context, if and when we need it. Unassigning for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants