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
// Originally from https://raw.githubusercontent.com/EOSIO/eosjs/v16.0.9/src/format.js | |
// eosjs2 does not have this function | |
import Long from 'long'; | |
function bytesToHex(bytes) { | |
let leHex = ''; | |
for (const b of bytes) { | |
const n = Number(b).toString(16); | |
leHex += (n.length === 1 ? '0' : '') + n; | |
} |
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, PropTypes } from 'react' | |
import { G, Line, Path, Rect, Text } from 'react-native-svg' | |
import * as d3scale from 'd3-scale' | |
import { dateToShortString } from '../utils' | |
export default class Axis extends Component { | |
static propTypes = { | |
width: PropTypes.number.isRequired, | |
ticks: PropTypes.number.isRequired, | |
x: PropTypes.number, |
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 GoogleSignIn from 'react-native-google-sign-in' | |
const url = 'https://www.googleapis.com/drive/v3' | |
const uploadUrl = 'https://www.googleapis.com/upload/drive/v3' | |
const boundaryString = 'foo_bar_baz' // can be anything unique, needed for multipart upload https://developers.google.com/drive/v3/web/multipart-upload | |
let apiToken = null |
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, |
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
d3.csv('data.csv', (err, data) => { | |
if (err) { | |
console.log(err) | |
return | |
} | |
ReactDOM.render( | |
<App width={960} height={640} data={data} />, | |
document.getElementById('root'), | |
) | |
}) |
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, PropTypes } from 'react' | |
import { G, Line, Text } from 'react-native-svg' | |
import * as d3scale from 'd3-scale' | |
export default class Axis extends Component { | |
static propTypes = { | |
width: PropTypes.number.isRequired, | |
ticks: PropTypes.number.isRequired, | |
x: PropTypes.number, | |
y: PropTypes.number, |
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 Curve from './Curve'; | |
export default class PeanoCurve extends Curve { | |
createData (recLevel) { | |
this.points = []; | |
this.recLevel = recLevel; | |
if (recLevel <= 0) return; | |
// maxSize is used for rescaling point coordinates to [0,1] | |
this.maxSize = Math.pow(3, recLevel) - 1; // 3^recLevel - 1 will be the max coordinate of the data. | |
this.createDataRecursive(0, 0, Math.pow(3, recLevel), 0, 0); | |
return this.points; |
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 Curve from './Curve'; | |
export default class HilbertCurve extends Curve { | |
constructor () { | |
super(); | |
} | |
createData (recLevel) { | |
this.points = []; | |
this.recLevel = recLevel; | |
if(recLevel <= 0) return; |