-
Notifications
You must be signed in to change notification settings - Fork 525
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
Audits and Adds typescript props, definitions, and demo: VictoryZoomContainer #1536
Merged
wsparsons
merged 12 commits into
master
from
task/audit-victory-zoom-container-typescript-props
May 4, 2020
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7c5026d
Updates the defined props for VictoryZoomContainerProps interface
wsparsons 0cef60e
Changes the name from CursorData to CoordinatesPropType
wsparsons 5f8e9c3
Adds ZoomContainerDemo to app
wsparsons dad021c
Adds ZoomContainerDemo
wsparsons 3712fe4
Fixes type errors for zoom container demo
wsparsons 7a49c53
Fixes type errors for zoom container demo
wsparsons e124b52
Updates BrushContainer to use DomainTuple instead of RangleTuple to a…
wsparsons e5156ba
Updates ZoomContainer to use DomainTuple instead of RangleTuple to ac…
wsparsons b1e42fe
Fixes type errors and removes unused proptypes and function from zoom…
wsparsons 7ca999e
Removes the optional property for domain
wsparsons 4439701
Removes uninvoked function
wsparsons 68a8f49
Removes third argument since in random method for lodash should be a …
wsparsons File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
/*eslint-disable no-magic-numbers,react/no-multi-comp */ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import { range, merge, random, minBy, maxBy, last, round } from "lodash"; | ||
import { range, merge, random, minBy, maxBy, last } from "lodash"; | ||
import { VictoryChart } from "Packages/victory-chart/src/index"; | ||
import { VictoryStack } from "Packages/victory-stack/src/index"; | ||
import { VictoryGroup } from "Packages/victory-group/src/index"; | ||
|
@@ -61,11 +61,6 @@ class CustomChart extends React.Component { | |
x: [data[0].x, last(data).x] | ||
}; | ||
} | ||
getZoomFactor() { | ||
const { zoomedXDomain } = this.state; | ||
const factor = 10 / (zoomedXDomain[1] - zoomedXDomain[0]); | ||
return round(factor, factor < 3 ? 1 : 0); | ||
} | ||
|
||
render() { | ||
const renderedData = this.getData(); | ||
|
@@ -123,7 +118,7 @@ export default class App extends React.Component { | |
|
||
getZoomDomain() { | ||
return { | ||
y: [random(0, 0.4, 0.1), random(0.6, 1, 0.1)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ended up removing this since https://lodash.com/docs/4.17.15#random says the third argument should be a boolean. not sure if the |
||
y: [random(0, 0.4), random(0.6, 1)] | ||
}; | ||
} | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ended up removing this uninvoked function. not sure if this should be used in the demo and somehow got missed?