Skip to content

[WIP] Feature/scatter plot basic - #6

Open
rainsoupah wants to merge 15 commits into
masterfrom
feature/scatter-plot-basic
Open

[WIP] Feature/scatter plot basic#6
rainsoupah wants to merge 15 commits into
masterfrom
feature/scatter-plot-basic

Conversation

@rainsoupah

Copy link
Copy Markdown
Contributor

A basic scatterplot to serve as minimized view of scatter pie. The plan is to combine with scatter pie to create both minimized view and expanded views.

@rainsoupah
rainsoupah changed the base branch from feature/breakdown to master September 7, 2018 19:10

@brianbancroft brianbancroft left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a choice arrangement of words. More a comment, much less a review.

Comment thread demo/sb-container.js
const drawAScatter = (left, top) => {
return (
<GlyphDot
key={Math.random()}

@brianbancroft brianbancroft Sep 12, 2018

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is more commentary, and it's more intended for @woozyking. Please don't see this as a request for change at this time. I've just since run into a relevant piece in the React docs, which might be worth bringing to light. This is certainly not a critique of the work being done at this time!

The reason why I brought up math.random() as a key being a bad idea is that it causes issues with the process of reconciliation, where React tries to determine whether a subset of a component should be updated, or whether an entire component should be rendered.

The end of the page I've linked to seems to suggest that when employing math.random() as a key, there is a much higher chance that the element in question will be rebuilt completely, rather than partially.

If that's what is intended the context of this code, I'm not sure. d3 and charts being what they are, maybe stripping down and rebuilding is exactly what we want here.

https://reactjs.org/docs/reconciliation.html

@woozyking woozyking Sep 12, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both @y629wang and yourself have mixed this with the case from the last PR #4 (comment), where it did make sense and the intent was to re-render the tooltip to take advantage of the dynamically computed boundary offered by vx.

From the look of this case, there's no reason to use Math.random() as key.

Comment thread demo/sb-container.js
const drawAScatter = (left, top) => {
return (
<GlyphDot
key={Math.random()}

@woozyking woozyking Sep 12, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both @y629wang and yourself have mixed this with the case from the last PR #4 (comment), where it did make sense and the intent was to re-render the tooltip to take advantage of the dynamically computed boundary offered by vx.

From the look of this case, there's no reason to use Math.random() as key.

)
}

// eslint-disable-next-line

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to use linter disable (and frankly we should minimize the use of it), since you're trying to handle the case of unused variable but the unused variable is a positional argument of the function handler -- simply remove it:

const scatterShape = (d) => { }

will do

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants