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
import React from 'react'; | |
import { View, StyleSheet, Text } from 'react-native'; | |
export default function LevelSeparator({ label, height }) { | |
return ( | |
<View style={[styles.container, { height }]}> | |
<Text style={styles.label}> | |
{label.toFixed(0)} | |
</Text> | |
<View style={styles.separatorRow}/> |
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
export default class lineChartExample extends Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<LevelSeparator height={30} label={10} /> | |
</View> | |
); | |
} | |
} |
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
import React from 'react'; | |
import { View, StyleSheet } from 'react-native'; | |
import LevelSeparator from './LevelSeparator'; | |
export const range = (n) => { | |
return [...Array(n).keys()]; | |
}; | |
function createSeparator(totalCount, topValue, index, height) { |
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
export default class lineChartExample extends Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<SeparatorsLayer topValue={10} separators={5} height={100} /> | |
</View> | |
); | |
} | |
} |
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
import { Point } from './pointUtils'; | |
export const startingPoint = Point(-20 , 8); | |
const endingPoint = Point(242, 100); | |
export function vectorTransform(point, maxValue, scaleCount) { | |
return Point( | |
point.x * (endingPoint.x / scaleCount) + endingPoint.x / scaleCount, | |
point.y * (endingPoint.y / maxValue) | |
); |
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
import React from 'react'; | |
export const Point = (x, y) => { | |
return { x, y }; | |
}; | |
export const dist = (pointA, pointB) => { | |
return Math.sqrt( | |
(pointA.x - pointB.x) * (pointA.x - pointB.x) + | |
(pointA.y - pointB.y) * (pointA.y - pointB.y) |
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
export const keyGen = (serializable, anotherSerializable) => { | |
return `${JSON.stringify(serializable)}-${JSON.stringify(anotherSerializable)}`; | |
}; |
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
import React from 'react'; | |
import { View } from 'react-native'; | |
import { dist, angle, pointPropTypes, add } from './pointUtils'; | |
import { keyGen } from './keyUtils'; | |
function toLine(pointA, pointB, color, opacity) { | |
return ( | |
<View | |
key={keyGen(pointA, pointB)} |
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
import SeparatorsLayer from './SeparatorsLayer'; | |
import PointsPath from './PointsPath'; | |
import { Point } from './pointUtils'; | |
import { startingPoint, vectorTransform } from './Scaler'; | |
const lightBlue = '#40C4FE'; | |
const green = '#53E69D'; | |
const lightBluePoints = [Point(0, 0), Point(1, 2), Point(2, 3), Point(3, 6), Point(5, 6)]; | |
const greenPoints = [Point(0, 2), Point(3, 4), Point(4, 0), Point(5, 10)]; |
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
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
View | |
} from 'react-native'; | |
import SeparatorsLayer from './SeparatorsLayer'; | |
import PointsPath from './PointsPath'; |
OlderNewer