未验证 提交 51776d26 编写于 作者: P Peter Pan 提交者: GitHub

fix: fix typo (#856)

上级 1050e287
#!/usr/bin/env node
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-console */
......
......@@ -14,6 +14,8 @@
* limitations under the License.
*/
// cSpell:words esmodules
module.exports = {
extends: '@snowpack/app-scripts-react/babel.config.json',
presets: [
......
......@@ -14,6 +14,8 @@
* limitations under the License.
*/
// cSpell:words pageview inited
import React, {FunctionComponent, Suspense, useCallback, useEffect, useMemo, useState} from 'react';
import {Redirect, Route, BrowserRouter as Router, Switch, useLocation} from 'react-router-dom';
import {THEME, matchMedia} from '~/utils/theme';
......
......@@ -45,7 +45,7 @@ type ChartProps = {
const Chart: FunctionComponent<ChartProps & WithStyled> = ({cid, width, height, className, children}) => {
const [maximized, setMaximized] = useState(false);
const toggleMaximze = useCallback(
const toggleMaximize = useCallback(
(id: symbol, value: boolean) => {
if (id === cid) {
setMaximized(value);
......@@ -54,11 +54,11 @@ const Chart: FunctionComponent<ChartProps & WithStyled> = ({cid, width, height,
[cid]
);
useEffect(() => {
ee.on('toggle-chart-size', toggleMaximze);
ee.on('toggle-chart-size', toggleMaximize);
return () => {
ee.off('toggle-chart-size', toggleMaximze);
ee.off('toggle-chart-size', toggleMaximize);
};
}, [toggleMaximze]);
}, [toggleMaximize]);
return (
<Div
......
......@@ -65,10 +65,10 @@ type ToggleChartToolboxItem = {
onClick?: (value: boolean) => unknown;
} & BaseChartToolboxItem;
export type ChartTooboxItem = NormalChartToolboxItem | ToggleChartToolboxItem;
export type ChartToolboxItem = NormalChartToolboxItem | ToggleChartToolboxItem;
type ChartToolboxProps = {
items: ChartTooboxItem[];
items: ChartToolboxItem[];
reversed?: boolean;
tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';
};
......@@ -98,7 +98,7 @@ const ChartToolbox: FunctionComponent<ChartToolboxProps & WithStyled> = ({
);
const getToolboxItem = useCallback(
(item: ChartTooboxItem, index: number) => (
(item: ChartToolboxItem, index: number) => (
<ToolboxItem
key={index}
active={item.toggle && !item.activeIcon && activeStatus[index]}
......
......@@ -76,10 +76,10 @@ const Wrapper = styled.div`
type ArgumentProps = {
value: ArgumentType | PropertyType;
expand?: boolean;
showNodeDodumentation?: () => unknown;
showNodeDocumentation?: () => unknown;
};
const Argument: FunctionComponent<ArgumentProps> = ({value, expand, showNodeDodumentation}) => {
const Argument: FunctionComponent<ArgumentProps> = ({value, expand, showNodeDocumentation}) => {
const [expanded, setExpanded] = useState(expand ?? false);
const expandable = useMemo(() => {
......@@ -105,7 +105,7 @@ const Argument: FunctionComponent<ArgumentProps> = ({value, expand, showNodeDodu
)}
</span>
{(value as PropertyType).documentation && (
<a className="argument-operation" onClick={() => showNodeDodumentation?.()}>
<a className="argument-operation" onClick={() => showNodeDocumentation?.()}>
<Icon type="question-circle" />
</a>
)}
......
......@@ -14,6 +14,8 @@
* limitations under the License.
*/
// cSpell:words strs
import React, {FunctionComponent, useCallback} from 'react';
import {Trans, useTranslation} from 'react-i18next';
import {borderRadius, em, transitionProps} from '~/utils/style';
......
......@@ -24,19 +24,19 @@ import {useTranslation} from 'react-i18next';
type NodePropertiesSidebarProps = {
data?: PropertiesType | null;
onClose?: () => unknown;
showNodeDodumentation?: () => unknown;
showNodeDocumentation?: () => unknown;
};
const NodePropertiesSidebar: FunctionComponent<NodePropertiesSidebarProps> = ({
data,
onClose,
showNodeDodumentation
showNodeDocumentation
}) => {
const {t} = useTranslation('graph');
return (
<GraphSidebar title={t('graph:node-properties')} onClose={onClose}>
<Properties {...data} showNodeDodumentation={showNodeDodumentation} />
<Properties {...data} showNodeDocumentation={showNodeDocumentation} />
</GraphSidebar>
);
};
......
......@@ -30,10 +30,10 @@ const Header = styled.div`
type PropertiesProps = PropertiesType & {
expand?: boolean;
showNodeDodumentation?: () => unknown;
showNodeDocumentation?: () => unknown;
};
const Properties: FunctionComponent<PropertiesProps> = ({properties, groups, expand, showNodeDodumentation}) => {
const Properties: FunctionComponent<PropertiesProps> = ({properties, groups, expand, showNodeDocumentation}) => {
const {t} = useTranslation('graph');
return (
......@@ -43,7 +43,7 @@ const Properties: FunctionComponent<PropertiesProps> = ({properties, groups, exp
name={t(`graph:properties.${property.name}`)}
values={property.values}
key={index}
showNodeDodumentation={showNodeDodumentation}
showNodeDocumentation={showNodeDocumentation}
/>
))}
{groups?.map((group, index) => (
......@@ -54,7 +54,7 @@ const Properties: FunctionComponent<PropertiesProps> = ({properties, groups, exp
{...property}
key={anotherIndex}
expand={expand}
showNodeDodumentation={showNodeDodumentation}
showNodeDocumentation={showNodeDocumentation}
/>
))}
</React.Fragment>
......
......@@ -49,10 +49,10 @@ const Wrapper = styled.div`
type PropertyProps = NameValues<ArgumentType | PropertyType> & {
expand?: boolean;
showNodeDodumentation?: () => unknown;
showNodeDocumentation?: () => unknown;
};
const Property: FunctionComponent<PropertyProps> = ({name, values, expand, showNodeDodumentation}) => {
const Property: FunctionComponent<PropertyProps> = ({name, values, expand, showNodeDocumentation}) => {
return (
<Wrapper>
<label className="property-name" title={name}>
......@@ -60,7 +60,7 @@ const Property: FunctionComponent<PropertyProps> = ({name, values, expand, showN
</label>
<div className="property-values">
{values.map((value, index) => (
<Argument key={index} value={value} expand={expand} showNodeDodumentation={showNodeDodumentation} />
<Argument key={index} value={value} expand={expand} showNodeDocumentation={showNodeDocumentation} />
))}
</div>
</Wrapper>
......
......@@ -22,16 +22,16 @@ import Icon from '~/components/Icon';
import styled from 'styled-components';
import {useTranslation} from 'react-i18next';
const DropZone = styled.div<{actived: boolean}>`
const DropZone = styled.div<{active: boolean}>`
${props =>
sameBorder({
width: '1px',
type: 'dashed',
radius: em(16),
color: props.actived ? 'var(--primary-color)' : undefined
color: props.active ? 'var(--primary-color)' : undefined
})}
background-color: ${props =>
props.actived ? 'var(--graph-uploader-active-background-color)' : 'var(--graph-uploader-background-color)'};
props.active ? 'var(--graph-uploader-active-background-color)' : 'var(--graph-uploader-background-color)'};
${size('43.2%', '68%')}
display: flex;
flex-direction: column;
......@@ -82,12 +82,12 @@ type UploaderProps = {
const Uploader: FunctionComponent<UploaderProps> = ({onClickUpload, onDropFiles}) => {
const {t} = useTranslation('graph');
const [actived, setActived] = useState(false);
const [active, setActive] = useState(false);
const onClick = useCallback(() => onClickUpload?.(), [onClickUpload]);
const onDrop = useCallback(
(e: React.DragEvent<HTMLDivElement>) => {
e.preventDefault();
setActived(false);
setActive(false);
if (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length) {
onDropFiles?.(e.dataTransfer.files);
}
......@@ -99,16 +99,16 @@ const Uploader: FunctionComponent<UploaderProps> = ({onClickUpload, onDropFiles}
if (e.currentTarget.contains(e.relatedTarget as Node | null)) {
return;
}
setActived(false);
setActive(false);
}, []);
return (
<>
<DropZone
actived={actived}
active={active}
onDrop={onDrop}
onDragOver={e => e.preventDefault()}
onDragEnter={() => setActived(true)}
onDragEnter={() => setActive(true)}
onDragLeave={onDragLeave}
>
<Icon type="upload" className="upload-icon" />
......
......@@ -14,6 +14,8 @@
* limitations under the License.
*/
// cSpell:words npts
import type {EChartOption, ECharts, EChartsConvertFinder} from 'echarts';
import type {HistogramData, OffsetData, OverlayData, OverlayDataItem} from '~/resource/histogram';
import LineChart, {LineChartRef} from '~/components/LineChart';
......
......@@ -45,14 +45,14 @@ const StyledInput = styled.input<{rounded?: boolean}>`
}
`;
type CustomeInputProps = {
type CustomInputProps = {
rounded?: boolean;
value?: string;
onChange?: (value: string) => unknown;
};
export type InputProps = Omit<React.ComponentPropsWithoutRef<'input'>, keyof CustomeInputProps | 'type' | 'className'> &
CustomeInputProps;
export type InputProps = Omit<React.ComponentPropsWithoutRef<'input'>, keyof CustomInputProps | 'type' | 'className'> &
CustomInputProps;
const Input = React.forwardRef<HTMLInputElement, InputProps & WithStyled>(
({rounded, value, onChange, className, ...props}, ref) => (
......
......@@ -61,7 +61,7 @@ const Header = styled.div`
font-size: ${em(10)};
> a {
display: inline-blcok;
display: inline-block;
line-height: 1;
height: ${em(14)};
......
......@@ -301,7 +301,7 @@ const SampleChart: FunctionComponent<SampleChartProps> = ({
return null;
}, [viewed, loading, error, data, step, entityProps, t, content]);
const Previewer = useMemo(() => {
const Previewer = useMemo<React.ReactNode>(() => {
if (!previewer) {
return null;
}
......
......@@ -47,7 +47,8 @@ const Label = styled.div`
font-size: ${em(10)};
> a {
display: inline-blcok;
display: inline-block;
cursor: pointer;
line-height: 1;
height: ${em(14)};
......@@ -112,10 +113,10 @@ const StepSlider: FunctionComponent<StepSliderProps> = ({onChange, onChangeCompl
<div>{`${t('sample:step')}: ${steps[step] ?? '...'}`}</div>
<Tippy placement="right" theme="tooltip" content={t('sample:step-tip')}>
<div className="step-buttons">
<a href="javascript:void(0)" onClick={prevStep}>
<a onClick={prevStep}>
<Icon type="chevron-up" />
</a>
<a href="javascript:void(0)" onClick={nextStep}>
<a onClick={nextStep}>
<Icon type="chevron-down" />
</a>
</div>
......
......@@ -14,6 +14,8 @@
* limitations under the License.
*/
// cSpell:words coord zlevel
import * as chart from '~/utils/chart';
import type {EChartOption, ECharts, EChartsConvertFinder} from 'echarts';
......
......@@ -14,6 +14,8 @@
* limitations under the License.
*/
// cSpell:words zlevel
import {MutableRefObject, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState} from 'react';
import {position, primaryColor, size} from '~/utils/style';
......
......@@ -115,7 +115,7 @@ const Graph: FunctionComponent = () => {
useEffect(() => {
if (data?.data.size) {
setFiles([new File([data.data], data.filename || 'unknwon_model')]);
setFiles([new File([data.data], data.filename || 'unknown_model')]);
}
}, [data]);
......@@ -185,7 +185,7 @@ const Graph: FunctionComponent = () => {
<NodePropertiesSidebar
data={nodeData}
onClose={() => setNodeData(null)}
showNodeDodumentation={() => graph.current?.showNodeDocumentation(nodeData)}
showNodeDocumentation={() => graph.current?.showNodeDocumentation(nodeData)}
/>
</Aside>
);
......
......@@ -14,6 +14,8 @@
* limitations under the License.
*/
// cSpell:words strs
export type Property = {
name?: string;
value: string;
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import React, {FunctionComponent, LazyExoticComponent} from 'react';
export enum Pages {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import {ActionTypes} from './types';
import type {Model} from './types';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {GraphActionTypes, GraphState} from './types';
import {ActionTypes} from './types';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {RootState} from '../index';
export const model = (state: RootState) => state.graph.model;
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
export type Model = FileList | File[] | null;
export enum ActionTypes {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import * as graphActions from './graph/actions';
import * as graphSelectors from './graph/selectors';
import * as runsActions from './runs/actions';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {Page, Runs} from './types';
import {ActionTypes} from './types';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {RunsActionTypes, RunsState} from './types';
import {ActionTypes} from './types';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {Page} from './types';
import type {RootState} from '../index';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
export type Runs = string[];
export enum ActionTypes {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import {ActionTypes} from './types';
import type {Theme} from './types';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import {THEME, autoTheme} from '~/utils/theme';
import type {ThemeActionTypes, ThemeState} from './types';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {RootState} from '../index';
export const theme = (state: RootState) => state.theme.theme;
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {Theme} from '~/utils/theme';
export type {Theme} from '~/utils/theme';
......
......@@ -14,6 +14,8 @@
* limitations under the License.
*/
// cSpell:words mpga
interface AudioPlayerOptions {
context?: AudioContext;
volume?: number;
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
// cSpell:words unobserves
/**
* The **ResizeObserver** interface reports changes to the dimensions of an
* [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element)'s content
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
declare module 'echarts-gl';
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
declare global {
interface Window {
webkitAudioContext: AudioContext;
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
/* Use this file to declare any custom file extensions for importing */
/* Use this folder to also add/extend a package d.ts file, if needed. */
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {Data, Worker} from './types';
interface Audio {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {Worker} from './types';
const worker: Worker = async io => {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {Worker} from './types';
const worker: Worker = async io => {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {Worker} from './types';
const worker: Worker = async io => {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {Data, Worker} from './types';
const worker: Worker = async io => {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {Data, Worker} from './types';
interface Image {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
/* eslint-disable no-console */
import IO from './io';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
/* eslint-disable no-console */
import crypto, {BinaryLike} from 'crypto';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {Data, Worker} from './types';
const worker: Worker = async io => {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type {Data, Worker} from './types';
const worker: Worker = async io => {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import type IO from './io';
export type Worker = (io: IO) => Promise<void>;
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import {Request, Response} from 'express';
import IO from './builder/io';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import {Request, Response} from 'express';
import fs from 'fs/promises';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
export default [
{
wallTime: 1512549785061.623,
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
// cSpell:disable
export default {
runs: ['train', 'test'],
tags: [
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
export default ['embeddings', 'scalar', 'image', 'audio', 'graph', 'histogram', 'pr_curve'];
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import {Request} from 'express';
export default (req: Request) => {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
export default {
runs: ['train', 'test'],
tags: [
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
// cSpell:disable
import {Request, Response} from 'express';
import fetch from 'isomorphic-unfetch';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
export default [
[
1515224840945.252,
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
export default {
runs: ['train', 'test'],
tags: [
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import {Request, Response} from 'express';
import fs from 'fs/promises';
import mime from 'mime-types';
import path from 'path';
const images = ['1.jpeg', '2.jpeg', '3.jpeg', '4.jpeg', '5.gif', '6.gif', '7.gif'];
const images = ['1.jpeg', '2.jpeg', '3.jpeg', '4.jpeg', '5.gif', '6.gif', '7.gif', '8.jpeg'];
export default async (req: Request, res: Response) => {
const index = (+req.query.index ?? 0) % images.length;
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
export default [
{
wallTime: 1512549785061.623,
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
// cSpell:disable
export default {
runs: ['train', 'test'],
tags: [
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import {Request} from 'express';
export default (request: Request) => {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import {Request} from 'express';
export default (request: Request) => {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
export default {
runs: ['train', 'test'],
tags: [
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import {Request} from 'express';
export default (request: Request) => {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
export default {
runs: ['train', 'test'],
tags: [
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
/* eslint-disable no-console */
import express from 'express';
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
import {Request, Response} from 'express';
import faker from 'faker';
......
......@@ -14,6 +14,8 @@
* limitations under the License.
*/
// cSpell:words actived nextcode
const view = require('./view');
const host = {};
......
......@@ -14,6 +14,8 @@
* limitations under the License.
*/
// cSpell:words grapher selectall nodesep ranksep rankdir pbtxt
const zip = require('netron/src/zip');
const gzip = require('netron/src/gzip');
const tar = require('netron/src/tar');
......@@ -1337,7 +1339,7 @@ view.ModelFactoryService = class {
_filter(context) {
const identifier = context.identifier.toLowerCase();
const list = this._extensions.filter(entry => identifier.endsWith(entry.extension)).map(extry => extry.id);
const list = this._extensions.filter(entry => identifier.endsWith(entry.extension)).map(entry => entry.id);
return Array.from(new Set(list));
}
......@@ -1347,6 +1349,7 @@ view.ModelFactoryService = class {
return Promise.reject(new ModelError('File has no content.', true));
}
const list = [
// cSpell:disable
{name: 'ELF executable', value: /^\x7FELF/},
{name: 'Git LFS header', value: /^version https:\/\/git-lfs.github.com\/spec\/v1\n/},
{name: 'Git LFS header', value: /^oid sha256:/},
......@@ -1358,6 +1361,7 @@ view.ModelFactoryService = class {
{name: 'StringIntLabelMapProto data', value: /^item\s*{\r?\n\s*id:/},
{name: 'StringIntLabelMapProto data', value: /^item\s*{\r?\n\s*name:/},
{name: 'Python source code', value: /^\s*import sys, types, os;/}
// cSpell:enable
];
const text = new TextDecoder().decode(buffer.subarray(0, Math.min(1024, buffer.length)));
for (const item of list) {
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
// cSpell:words autorestart
declare type App = {
name: string;
script: string;
......
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
declare module '@visualdl/core/builder/environment';
/**
* Copyright 2020 Baidu Inc. All Rights Reserved.
*
* 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.
*/
/* eslint-disable no-console */
import {config} from 'dotenv';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册