Skip to content

Commit

Permalink
local
Browse files Browse the repository at this point in the history
  • Loading branch information
Enya Shen committed Jul 15, 2018
1 parent 6a4010e commit dd6b6ca
Show file tree
Hide file tree
Showing 34 changed files with 7,289 additions and 222 deletions.
Binary file modified images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/logo0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/logo1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="UTF-8" />
<title>Voyager 2</title>
<title>TsVis</title>
<style>
html {
height: 100%;
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="UTF-8" />
<title>Voyager 2</title>
<title>TsVis 1.0</title>
<link href="./dist/style.css" rel="stylesheet">

<style>
Expand Down
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{
"name": "datavoyager",
"version": "2.0.0-alpha.15",
"name": "tsvis",
"version": "1.0-alpha.1",
"description": "",
"author": {
"name": "UW Interactive Data Lab",
"url": "http://idl.cs.washington.edu"
"name": "Enaic",
"url": "http://tsvis.com"
},
"collaborators": [
"Kanit Wongsuphasawat <[email protected]> (http://kanitw.yellowpigz.com)",
"Dominik Moritz <[email protected]> (http://domoritz.de)",
"Jeffrey Heer <[email protected]> (http://jheer.org)"
""
],
"repository": {
"type": "git",
"url": "https://github.com/vega/voyager.git"
"url": "https://github.com/shenenya/voyager.git"
},
"main": "build/lib-voyager.js",
"license": "BSD-3-Clause",
Expand Down
12 changes: 6 additions & 6 deletions src/components/bookmark/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BookmarkBase extends React.PureComponent<BookmarkProps, any> {
return (
<div>
<button onClick={this.openModal}>
<i className="fa fa-bookmark" /> Bookmarks ({this.props.bookmark.count})
<i className="fa fa-bookmark" /> 书签 ({this.props.bookmark.count})
</button>

<Modal
Expand All @@ -45,17 +45,17 @@ export class BookmarkBase extends React.PureComponent<BookmarkProps, any> {
className="voyager"
>
<div className="modal-header">
<a className="right" onClick={this.closeModal}>Close</a>
<h3>Bookmarks ({this.props.bookmark.count})</h3>
<a className="right" onClick={this.closeModal}>关闭</a>
<h3>书签({this.props.bookmark.count}</h3>
<a styleName="bookmark-list-util" onClick={this.onClearAll}>
<i className="fa fa-trash-o"/>
{' '}
Clear all
清空
</a>
<a styleName="bookmark-list-util" onClick={this.onExport}>
<i className="fa fa-clipboard"/>
{' '}
Export
导出
</a>
</div>

Expand Down Expand Up @@ -126,7 +126,7 @@ export class BookmarkBase extends React.PureComponent<BookmarkProps, any> {
{
(bookmarkPlotListItems.length > 0) ?
bookmarkPlotListItems :
<div styleName="vis-list-empty">You have no bookmarks</div>
<div styleName="vis-list-empty"></div>
}
</div>
);
Expand Down
72 changes: 37 additions & 35 deletions src/components/data-pane/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from 'react';
import * as CSSModules from 'react-css-modules';
import {connect} from 'react-redux';
import {Dataset, State} from '../../models';
import {VoyagerConfig} from '../../models/config';
import {selectConfig, selectDataset} from '../../selectors/';
import {DataSelector} from '../data-selector';
import * as styles from './data-pane.scss';
import {FieldList, PresetWildcardFieldList} from './field-list';
import * as React from "react";
import * as CSSModules from "react-css-modules";
import { connect } from "react-redux";
import { Dataset, State } from "../../models";
import { VoyagerConfig } from "../../models/config";
import { selectConfig, selectDataset } from "../../selectors/";
import { DataSelector } from "../data-selector";
import * as styles from "./data-pane.scss";
import { FieldList, PresetWildcardFieldList } from "./field-list";

export interface DataPanelProps {
data: Dataset;
Expand All @@ -15,33 +15,37 @@ export interface DataPanelProps {

export class DataPaneBase extends React.PureComponent<DataPanelProps, {}> {
public render() {
const {name} = this.props.data;
const { name } = this.props.data;
const fieldCount = this.props.data.schema.fieldSchemas.length;
const {showDataSourceSelector, manualSpecificationOnly} = this.props.config;
const {
showDataSourceSelector,
manualSpecificationOnly
} = this.props.config;

const fields = fieldCount > 0 ? (
<div styleName="data-pane-section">
<h3>Fields</h3>
<FieldList/>
</div>) : null;
const fields =
fieldCount > 0 ? (
<div styleName="data-pane-section">
<h3>变量</h3>
<FieldList />
</div>
) : null;

const wildcardFields = !manualSpecificationOnly && fieldCount > 0 && (
<div styleName="data-pane-section">
<h3>Wildcard Fields</h3>
<PresetWildcardFieldList/>
</div>
);
const wildcardFields = !manualSpecificationOnly &&
fieldCount > 0 && (
<div styleName="data-pane-section">
<h3>分类变量集</h3>
<PresetWildcardFieldList />
</div>
);
return (
<div className="pane" styleName="data-pane">
<h2 styleName="data-pane-title">Data</h2>
<h2 styleName="data-pane-title">数据</h2>
<div>
<span styleName="current-dataset">
<i className="fa fa-database"/>
{' '}
{name}
<i className="fa fa-database" /> {name}
</span>
<span className="right">
{showDataSourceSelector ? <DataSelector title="Change"/> : null}
{showDataSourceSelector ? <DataSelector title="修改" /> : null}
</span>
</div>
{fields}
Expand All @@ -51,11 +55,9 @@ export class DataPaneBase extends React.PureComponent<DataPanelProps, {}> {
}
}

export const DataPane = connect(
(state: State) => {
return {
data: selectDataset(state),
config: selectConfig(state)
};
}
)(CSSModules(DataPaneBase, styles));
export const DataPane = connect((state: State) => {
return {
data: selectDataset(state),
config: selectConfig(state)
};
})(CSSModules(DataPaneBase, styles));
2 changes: 1 addition & 1 deletion src/components/data-pane/type-changer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class TypeChangerBase extends React.PureComponent<TypeChangerProps, {}> {
const {validTypes} = this.props;
return (
<div styleName='type-changer'>
<h4>Type</h4>
<h4>类型</h4>
{validTypes.map(validType => {
return (
<label key={validType}>
Expand Down
32 changes: 15 additions & 17 deletions src/components/data-selector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {Dataset, State} from '../../models';
import {selectDataset} from '../../selectors';

export interface DataSelectorOwnProps {
title: 'Change' | 'Load';
title: '修改' | '打开';
}

export interface DataSelectorConnectProps {
Expand Down Expand Up @@ -70,14 +70,14 @@ export class DataSelectorBase extends React.PureComponent<DataSelectorProps, Dat
className="voyager"
>
<div className='modal-header'>
<a styleName='modal-close' onClick={this.closeModal}>close</a>
<h3>Add Dataset</h3>
<a styleName='modal-close' onClick={this.closeModal}>关闭</a>
<h3>添加数据</h3>
</div>
<Tabs className={styles['react-tabs']}>
<TabList className={styles['tab-list']}>
<Tab className={styles.tab}>Change Dataset</Tab>
<Tab className={styles.tab}>Paste or Upload Data</Tab>
<Tab className={styles.tab}>From URL</Tab>
<Tab className={styles.tab}>修改</Tab>
<Tab className={styles.tab}>粘贴上传数据</Tab>
<Tab className={styles.tab}>链接</Tab>
</TabList>

<TabPanel className={styles['tab-panel']}>
Expand Down Expand Up @@ -124,10 +124,10 @@ export class DataSelectorBase extends React.PureComponent<DataSelectorProps, Dat
return (
<div styleName='upload-panel'>
<div className='form-group'>
<label htmlFor='data-file'>File</label>
<label htmlFor='data-file'>文件</label>
<input id='data-file' type='file' onChange={this.onFileChange} />
</div>
<p>Upload a data file, or paste data in CSV format into the input.</p>
<p>上传数据文件,或粘贴CSV格式数据。</p>
<div styleName='dropzone-target' />
</div>
);
Expand All @@ -137,20 +137,18 @@ export class DataSelectorBase extends React.PureComponent<DataSelectorProps, Dat
return (
<div styleName='url-panel'>
<p>
Add the name of the dataset and the URL to a <b> JSON </b>, <b> CSV </b> (with header), or
<b> TSV </b> file. Make sure that the formatting is correct and clean the data before adding it.
The added dataset is only visible to you.
增加<b> JSON </b><b> CSV </b>(包含表头)、或<b> TSV </b>类型数据文件名和链接。确保格式正确,清洗完成。所添加数据仅你可见。
</p>
<div className='form-group'>
<label htmlFor='filetype-selector'>File Type</label>
<label htmlFor='filetype-selector'>文件类型</label>
<select value={this.state.fileType} onChange={this.handleFileTypeChange} id='filetype-selector'>
<option value="json">JSON</option>
<option value="csv">CSV</option>
<option value="tsv">TSV</option>
</select>
</div>
<div className='form-group'>
<label htmlFor='data-name'>Name</label>
<label htmlFor='data-name'>名称</label>
<input
name='dataName'
value={this.state.dataName}
Expand All @@ -160,7 +158,7 @@ export class DataSelectorBase extends React.PureComponent<DataSelectorProps, Dat
/>
</div>
<div className='form-group'>
<label htmlFor='data-url'>URL</label>
<label htmlFor='data-url'>链接</label>
<input
name='dataUrl'
value={this.state.dataUrl}
Expand All @@ -169,7 +167,7 @@ export class DataSelectorBase extends React.PureComponent<DataSelectorProps, Dat
type='name'
/>
</div>
<button onClick={this.onDataUrlSubmit}>Add Dataset</button>
<button onClick={this.onDataUrlSubmit}>添加数据</button>
</div>
);
}
Expand All @@ -182,7 +180,7 @@ export class DataSelectorBase extends React.PureComponent<DataSelectorProps, Dat
return (
<div styleName='paste-panel'>
<div className='form-group'>
<label htmlFor='data-name'>Name</label>
<label htmlFor='data-name'>名称</label>
<input
name='dataName'
value={this.state.dataName}
Expand All @@ -198,7 +196,7 @@ export class DataSelectorBase extends React.PureComponent<DataSelectorProps, Dat
onChange={this.handleTextChange}
/>
</div>
<button onClick={this.onDataTextSubmit}>Add Data</button>
<button onClick={this.onDataTextSubmit}>添加数据</button>
</div>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/encoding-pane/encoding-shelf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class EncodingShelfBase extends React.PureComponent<
const {item, isOver} = this.props;
return (
<span styleName={isOver ? 'placeholder-over' : item ? 'placeholder-active' : 'placeholder'}>
Drop a field here
选择变量
</span>
);
}
Expand Down Expand Up @@ -226,7 +226,7 @@ const encodingShelfTarget: DropTargetSpec<EncodingShelfProps> = {
});
break;
default:
throw new Error('Field dragged from unregistered source type to EncodingShelf');
throw new Error('变量来自未知源');
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/encoding-pane/function-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ export class FunctionPickerBase extends React.PureComponent<FunctionPickerProps,
{
wildcardHandler && (
<label styleName="wildcard-button">
<input type="checkbox" onChange={this.onCheck}/> Wildcard
<input type="checkbox" onChange={this.onCheck}/> 通配符
</label>
)}
<h4>Function</h4>
<h4>功能</h4>
{checkboxradios}
</div>
);
Expand Down
12 changes: 6 additions & 6 deletions src/components/encoding-pane/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class EncodingPanelBase extends React.PureComponent<EncodingPanelProps, {}> {
const nonPositionShelves = ['size', 'color', 'shape', 'detail', 'text'].map(this.encodingShelf, this);
const wildcardShelvesGroup = !manualSpecificationOnly && (
<div styleName="shelf-group">
<h3>Wildcard Shelves</h3>
<h3>通配符架</h3>
{[...anyEncodings.map((_, i) => i),
-1 // map the empty placeholder to -1
].map(this.wildcardShelf, this)}
Expand All @@ -66,11 +66,11 @@ class EncodingPanelBase extends React.PureComponent<EncodingPanelProps, {}> {
<a className="right" onClick={this.onClear}>
<i className="fa fa-eraser"/>
{' '}
Clear
清空
</a>

<h2>
Encoding
编码
{specPreview && ' Preview'}
</h2>

Expand All @@ -82,20 +82,20 @@ class EncodingPanelBase extends React.PureComponent<EncodingPanelProps, {}> {
<div className="right">
{this.markPicker()}
</div>
<h3>Mark</h3>
<h3>符号</h3>
{nonPositionShelves}
</div>

<div styleName="shelf-group">
<h3>Facet</h3>
<h3>侧面</h3>
{facetShelves}
</div>

{/* TODO: correctly highlight field in the wildcard */}
{wildcardShelvesGroup}

<div styleName="shelf-group">
<h3>Filter</h3>
<h3>过滤器</h3>
{this.filterPane()}
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/components/filter-pane/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class FilterPaneBase extends React.PureComponent<FilterPaneProps, {}> {
case TimeUnit.YEARMONTHDATE:
return true;
default:
throw new Error(timeUnit + ' is not supported');
throw new Error('不支持' + timeUnit);
}
}
}
Expand All @@ -203,11 +203,11 @@ const filterShelfTarget: DropTargetSpec<FilterPaneProps> = {
}
const {filter} = monitor.getItem() as DraggedFieldIdentifier;
if (isWildcard(filter.field)) {
window.alert('Cannot add wildcard filter');
throw new Error('Cannot add wildcard filter');
window.alert('无法添加通配符过滤器');
throw new Error('无法添加通配符过滤器');
}
if (filterHasField(props.filters, filter.field)) {
window.alert('Cannot add more than one filter of the same field');
window.alert('同一变量的过滤器不能大于一个');
return;
}
props.handleAction({
Expand Down
Loading

0 comments on commit dd6b6ca

Please sign in to comment.