Conversation
rokotyan
approved these changes
May 20, 2024
|
|
||
| export default function RangePlot (): JSX.Element { | ||
| const legendItems = [{ name: 'Women', color: '#FF6B7E' }, { name: 'Men', color: '#4D8CFD' }] | ||
| const style: React.CSSProperties = { width: '100%', height: height } |
| export default function RangePlot (): JSX.Element { | ||
| const legendItems = [{ name: 'Women', color: '#FF6B7E' }, { name: 'Men', color: '#4D8CFD' }] | ||
| const style: React.CSSProperties = { width: '100%', height: height } | ||
| const styleAb: React.CSSProperties = { position: 'absolute', top: 0, left: 0, width: '100%', height: height } |
| const legendItems = [{ name: 'Women', color: '#FF6B7E' }, { name: 'Men', color: '#4D8CFD' }] | ||
| const style: React.CSSProperties = { width: '100%', height: height } | ||
| const styleAb: React.CSSProperties = { position: 'absolute', top: 0, left: 0, width: '100%', height: height } | ||
| const tooltipTriggers = { |
| ></VisScatter> | ||
|
|
||
| <VisAxis type='x' numTicks={5} label={'Yearly Salary'} /> | ||
| <VisAxis type='y' tickFormat={(_, i: number) => data[i].occupation} numTicks={data.length} gridLine={false} /> |
709adac to
5eaef69
Compare
reb-dev
reviewed
May 21, 2024
Contributor
reb-dev
left a comment
There was a problem hiding this comment.
I really like the look of this example!
My only qualm is in regard to the style declarations.
- The container width by default is 100%, I think we can just specify the height directly through the height property
- I don't think we need to make positions absolute or have additional stylings for the scatter components, they should look the same without them (please correct me if I'm mistaken or missing something)
Neither is a huge deal, but I feel like the less code we have in our examples, the better. So if we can get away with removing some excess variables that would be ideal.
Contributor
There was a problem hiding this comment.
Is this file used anywhere?
| const yScale = Scale.scalePoint([0, 800]).domain(data.map(d => d.occupation)) | ||
| const lineData = processLineData(data) | ||
| const legendItems = [{ name: 'Women', color: '#FF6B7E' }, { name: 'Men', color: '#4D8CFD' }] | ||
| const style: React.CSSProperties = { width: '100%', height: height } |
Contributor
There was a problem hiding this comment.
Same comment from the angular example above. I would remove in favor of template declaration
5eaef69 to
cb158d3
Compare
reb-dev
approved these changes
May 22, 2024
Collaborator
Author
|
Thanks for the reviews! |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added an example for range plot to the gallery as part of the composite chart section. I suppose this can be a separate component eventually. But since it can be done with the current components I figured it could be useful for people.
My approach was to use 2 scatter plots and a line chart. If there's a better approach I'm happy to update.