-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dropdown for 3d-tiles example and uncomment batchID parsing
Resolve comments
- Loading branch information
Xintong Xia
committed
Apr 29, 2019
1 parent
57dee9f
commit 7ed6698
Showing
15 changed files
with
1,748 additions
and
63 deletions.
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
plugins: ['react'], | ||
extends: ['uber-jsx', 'eslint-config-uber-es2015', 'prettier', 'prettier/react'] | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2019 Uber Technologies, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
module.exports = function babelConfig(api) { | ||
api.cache(() => process.env.NODE_ENV === 'production'); // eslint-disable-line | ||
|
||
return { | ||
presets: ['@babel/preset-env'], | ||
plugins: [['@babel/plugin-proposal-class-properties', {loose: false}]] | ||
}; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import styled from 'styled-components'; | ||
import React, {PureComponent} from 'react'; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
max-width: 320px; | ||
background: #fff; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); | ||
padding: 12px 24px; | ||
margin: 20px; | ||
font-size: 13px; | ||
line-height: 2; | ||
color: #6b6b76; | ||
text-transform: uppercase; | ||
outline: none; | ||
z-index: 100; | ||
`; | ||
|
||
export default class ControlPanel extends PureComponent { | ||
_renderByCategories() { | ||
const {category, example, onChange, data} = this.props; | ||
const categories = Object.keys(data); | ||
|
||
return ( | ||
<select | ||
defaultValue={`${category}.${example}`} | ||
onChange={evt => { | ||
const categoryExample = evt.target.value; | ||
const value = categoryExample.split('.'); | ||
onChange({category: value[0], example: value[1]}); | ||
}} | ||
> | ||
{categories.map((c, i) => { | ||
const categoryExamples = data[c].examples; | ||
return ( | ||
<optgroup key={i} label={c}> | ||
{Object.keys(categoryExamples).map((e, j) => { | ||
return ( | ||
<option key={j} value={`${c}.${e}`}> | ||
{e} | ||
</option> | ||
); | ||
})} | ||
</optgroup> | ||
); | ||
})} | ||
</select> | ||
); | ||
} | ||
|
||
render() { | ||
return <Container>{this._renderByCategories()}</Container>; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (c) 2019 Uber Technologies, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
const {ArgumentParser} = require('argparse'); | ||
|
||
const parser = new ArgumentParser({ | ||
addHelp: true, | ||
description: 'Data converter' | ||
}); | ||
|
||
parser.addArgument(['-i', '--input'], { | ||
required: true, | ||
help: 'Path to raw data.' | ||
}); | ||
|
||
parser.addArgument(['-o', '--output'], { | ||
required: true, | ||
help: 'Path to generated index file.' | ||
}); | ||
|
||
// extract args from user input | ||
module.exports = function getArgs() { | ||
const args = parser.parseArgs(); | ||
const inputDir = args.input; | ||
const outputFilePath = args.output; | ||
|
||
console.log(inputDir, outputFilePath); // eslint-disable-line | ||
return { | ||
inputDir, | ||
outputFilePath | ||
}; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require('@babel/register'); | ||
require('babel-polyfill'); | ||
|
||
const args = require('./args'); | ||
const main = require('./main'); | ||
|
||
main(args()); |
Oops, something went wrong.