未验证 提交 098f7ec0 编写于 作者: P Peter Pan 提交者: GitHub

update demo to latest (#970)

* chore: update demo

* chore: update demo

* bump fe to 2.2.0

* bump fe to 2.2.0-1

* fix: docker runtime error
上级 0151d78b
...@@ -12,7 +12,7 @@ FROM python:3-alpine ...@@ -12,7 +12,7 @@ FROM python:3-alpine
WORKDIR /home/visualdl WORKDIR /home/visualdl
COPY --from=builder /home/visualdl/dist/* dist/ COPY --from=builder /home/visualdl/dist/* dist/
RUN apk add --no-cache jpeg-dev && \ RUN apk add --no-cache jpeg-dev libstdc++ && \
apk add --no-cache --virtual .build-deps build-base linux-headers zlib-dev && \ apk add --no-cache --virtual .build-deps build-base linux-headers zlib-dev && \
pip install --disable-pip-version-check --find-links=dist visualdl && \ pip install --disable-pip-version-check --find-links=dist visualdl && \
apk del --no-network .build-deps && \ apk del --no-network .build-deps && \
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"packages": [ "packages": [
"packages/*" "packages/*"
], ],
"version": "2.1.5", "version": "2.2.0-1",
"npmClient": "yarn", "npmClient": "yarn",
"useWorkspaces": true, "useWorkspaces": true,
"command": { "command": {
......
{ {
"name": "@visualdl/cli", "name": "@visualdl/cli",
"version": "2.1.5", "version": "2.2.0-1",
"description": "A platform to visualize the deep learning process and result.", "description": "A platform to visualize the deep learning process and result.",
"keywords": [ "keywords": [
"visualdl", "visualdl",
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
"dist" "dist"
], ],
"dependencies": { "dependencies": {
"@visualdl/server": "2.1.5", "@visualdl/server": "2.2.0-1",
"open": "8.0.9", "open": "8.0.9",
"ora": "5.4.0", "ora": "5.4.0",
"pm2": "4.5.6", "pm2": "4.5.6",
......
{ {
"name": "@visualdl/core", "name": "@visualdl/core",
"version": "2.1.5", "version": "2.2.0-1",
"description": "A platform to visualize the deep learning process and result.", "description": "A platform to visualize the deep learning process and result.",
"keywords": [ "keywords": [
"visualdl", "visualdl",
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
], ],
"dependencies": { "dependencies": {
"@tippyjs/react": "4.2.5", "@tippyjs/react": "4.2.5",
"@visualdl/netron": "2.1.5", "@visualdl/netron": "2.2.0-1",
"@visualdl/wasm": "2.1.5", "@visualdl/wasm": "2.2.0-1",
"bignumber.js": "9.0.1", "bignumber.js": "9.0.1",
"classnames": "2.3.1", "classnames": "2.3.1",
"d3": "6.7.0", "d3": "6.7.0",
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
"@types/snowpack-env": "2.3.3", "@types/snowpack-env": "2.3.3",
"@types/styled-components": "5.1.9", "@types/styled-components": "5.1.9",
"@types/three": "0.128.0", "@types/three": "0.128.0",
"@visualdl/mock": "2.1.5", "@visualdl/mock": "2.2.0-1",
"babel-plugin-styled-components": "1.12.0", "babel-plugin-styled-components": "1.12.0",
"dotenv": "9.0.2", "dotenv": "9.0.2",
"enhanced-resolve": "5.8.2", "enhanced-resolve": "5.8.2",
......
...@@ -63,7 +63,7 @@ const useECharts = <T extends HTMLElement, W extends HTMLElement = HTMLDivElemen ...@@ -63,7 +63,7 @@ const useECharts = <T extends HTMLElement, W extends HTMLElement = HTMLDivElemen
await import('echarts-gl'); await import('echarts-gl');
} }
const echartInstance = echarts.init((ref.current as unknown) as HTMLDivElement); const echartInstance = echarts.init(ref.current as unknown as HTMLDivElement);
ref.current.addEventListener('mouseleave', hideTip); ref.current.addEventListener('mouseleave', hideTip);
......
...@@ -251,10 +251,10 @@ const useTagFilter = (type: Page, running: boolean) => { ...@@ -251,10 +251,10 @@ const useTagFilter = (type: Page, running: boolean) => {
[state.tags] [state.tags]
); );
const runsInTags = useMemo(() => state.selectedRuns.filter(run => !!tags?.[run.label]?.length), [ const runsInTags = useMemo(
state.selectedRuns, () => state.selectedRuns.filter(run => !!tags?.[run.label]?.length),
tags [state.selectedRuns, tags]
]); );
return { return {
...state, ...state,
......
...@@ -51,7 +51,7 @@ function useThrottleFn<T extends Fn>(fn: T, options?: ThrottleOptions): ReturnVa ...@@ -51,7 +51,7 @@ function useThrottleFn<T extends Fn>(fn: T, options?: ThrottleOptions): ReturnVa
); );
return { return {
run: (throttled as any) as T, run: throttled as any as T,
cancel: throttled.cancel cancel: throttled.cancel
}; };
} }
......
...@@ -45,7 +45,7 @@ export const options: Record<Modes, EChartOption> = { ...@@ -45,7 +45,7 @@ export const options: Record<Modes, EChartOption> = {
}, },
offset: { offset: {
...baseOptions, ...baseOptions,
visualMap: ({ visualMap: {
type: 'continuous', type: 'continuous',
show: false, show: false,
dimension: 1, dimension: 1,
...@@ -53,7 +53,7 @@ export const options: Record<Modes, EChartOption> = { ...@@ -53,7 +53,7 @@ export const options: Record<Modes, EChartOption> = {
colorLightness: [0.5, 0.8], colorLightness: [0.5, 0.8],
colorSaturation: [0.5, 0.8] colorSaturation: [0.5, 0.8]
} }
} as unknown) as VisualMap.Continuous[], // Fix echarts type bug } as unknown as VisualMap.Continuous[], // Fix echarts type bug
xAxis: { xAxis: {
axisLine: { axisLine: {
onZero: false onZero: false
......
...@@ -68,7 +68,7 @@ export type BlobResponse = { ...@@ -68,7 +68,7 @@ export type BlobResponse = {
function getT(): Promise<TFunction> { function getT(): Promise<TFunction> {
return new Promise(resolve => { return new Promise(resolve => {
// Bug of i18next // Bug of i18next
i18next.changeLanguage((undefined as unknown) as string).then(t => resolve(t)); i18next.changeLanguage(undefined as unknown as string).then(t => resolve(t));
}); });
} }
......
...@@ -14,12 +14,7 @@ ...@@ -14,12 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import type {Data, Worker} from './types'; import type {Sample, TagData, Worker} from './types';
interface Audio {
step: number;
wallTime: number;
}
const worker: Worker = async io => { const worker: Worker = async io => {
const components = await io.getData<string[]>('/components'); const components = await io.getData<string[]>('/components');
...@@ -27,10 +22,10 @@ const worker: Worker = async io => { ...@@ -27,10 +22,10 @@ const worker: Worker = async io => {
return; return;
} }
const {runs, tags} = await io.save<Data>('/audio/tags'); const {runs, tags} = await io.save<TagData>('/audio/tags');
for (const [index, run] of runs.entries()) { for (const [index, run] of runs.entries()) {
for (const tag of tags[index]) { for (const tag of tags[index]) {
const list = (await io.save<Audio[]>('/audio/list', {run, tag})) ?? []; const list = (await io.save<Sample[]>('/audio/list', {run, tag})) ?? [];
for (const [index, audio] of list.entries()) { for (const [index, audio] of list.entries()) {
await io.saveBinary('/audio/audio', {run, tag, index, ts: audio.wallTime}); await io.saveBinary('/audio/audio', {run, tag, index, ts: audio.wallTime});
} }
......
...@@ -14,14 +14,15 @@ ...@@ -14,14 +14,15 @@
* limitations under the License. * limitations under the License.
*/ */
import type {Embedding, Worker} from './types'; import type {Worker} from './types';
const worker: Worker = async io => { interface Embedding {
const components = await io.getData<string[]>('/components'); name: string;
if (!components.includes('embeddings')) { shape: [number, number];
return; path: string;
} }
const worker: Worker = async io => {
const list = await io.save<Embedding[]>('/embedding/list'); const list = await io.save<Embedding[]>('/embedding/list');
await Promise.all( await Promise.all(
list.map(({name}) => list.map(({name}) =>
......
...@@ -14,15 +14,10 @@ ...@@ -14,15 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
import type {Data, Worker} from './types'; import type {TagData, Worker} from './types';
const worker: Worker = async io => { const worker: Worker = async io => {
const components = await io.getData<string[]>('/components'); const {runs, tags} = await io.save<TagData>('/histogram/tags');
if (!components.includes('histogram')) {
return;
}
const {runs, tags} = await io.save<Data>('/histogram/tags');
const q = []; const q = [];
for (const [index, run] of runs.entries()) { for (const [index, run] of runs.entries()) {
for (const tag of tags[index]) { for (const tag of tags[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.
*/
import type {Worker} from './types';
interface Indicator {
name: string;
type: string;
}
interface IndicatorData {
hparams: Indicator[];
metrics: Indicator[];
}
interface ListItem {
name: string;
hparams: Record<string, string | number>;
metrics: Record<string, string | number>;
}
const DataTypes = ['csv', 'tsv'];
const worker: Worker = async io => {
const q = [io.save<IndicatorData>('/hparams/indicators'), io.save<ListItem[]>('/hparams/list')] as const;
const [{metrics}, list] = await Promise.all(q);
for (const row of list) {
for (const metric of metrics) {
await io.save('/hparams/metric', {run: row.name, metric: metric.name});
}
}
await Promise.all(DataTypes.map(type => io.saveBinary('/hparams/data', {type})));
};
export default worker;
...@@ -14,23 +14,13 @@ ...@@ -14,23 +14,13 @@
* limitations under the License. * limitations under the License.
*/ */
import type {Data, Worker} from './types'; import type {Sample, TagData, Worker} from './types';
interface Image {
step: number;
wallTime: number;
}
const worker: Worker = async io => { const worker: Worker = async io => {
const components = await io.getData<string[]>('/components'); const {runs, tags} = await io.save<TagData>('/image/tags');
if (!components.includes('image')) {
return;
}
const {runs, tags} = await io.save<Data>('/image/tags');
for (const [index, run] of runs.entries()) { for (const [index, run] of runs.entries()) {
for (const tag of tags[index]) { for (const tag of tags[index]) {
const list = (await io.save<Image[]>('/image/list', {run, tag})) ?? []; const list = (await io.save<Sample[]>('/image/list', {run, tag})) ?? [];
for (const [index, image] of list.entries()) { for (const [index, image] of list.entries()) {
await io.saveBinary('/image/image', {run, tag, index, ts: image.wallTime}); await io.saveBinary('/image/image', {run, tag, index, ts: image.wallTime});
} }
......
...@@ -26,7 +26,19 @@ import {spawn} from 'child_process'; ...@@ -26,7 +26,19 @@ import {spawn} from 'child_process';
const host = '127.0.0.1'; const host = '127.0.0.1';
const publicPath = '/visualdl'; const publicPath = '/visualdl';
const pages = ['common', 'scalar', 'histogram', 'image', 'audio', 'graph', 'pr-curve', 'roc-curve', 'high-dimensional']; const pages = [
'common',
'scalar',
'histogram',
'image',
'audio',
'text',
'graph',
'pr-curve',
'roc-curve',
'high-dimensional',
'hyper-parameter'
];
const dataDir = path.resolve(__dirname, '../data'); const dataDir = path.resolve(__dirname, '../data');
async function start() { async function start() {
......
...@@ -14,15 +14,10 @@ ...@@ -14,15 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
import type {Data, Worker} from './types'; import type {TagData, Worker} from './types';
const worker: Worker = async io => { const worker: Worker = async io => {
const components = await io.getData<string[]>('/components'); const {runs, tags} = await io.save<TagData>('/pr-curve/tags');
if (!components.includes('pr_curve')) {
return;
}
const {runs, tags} = await io.save<Data>('/pr-curve/tags');
for (const [index, run] of runs.entries()) { for (const [index, run] of runs.entries()) {
await io.save('/pr-curve/steps', {run}); await io.save('/pr-curve/steps', {run});
for (const tag of tags[index]) { for (const tag of tags[index]) {
......
...@@ -14,15 +14,10 @@ ...@@ -14,15 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
import type {Data, Worker} from './types'; import type {TagData, Worker} from './types';
const worker: Worker = async io => { const worker: Worker = async io => {
const components = await io.getData<string[]>('/components'); const {runs, tags} = await io.save<TagData>('/roc-curve/tags');
if (!components.includes('roc_curve')) {
return;
}
const {runs, tags} = await io.save<Data>('/roc-curve/tags');
for (const [index, run] of runs.entries()) { for (const [index, run] of runs.entries()) {
await io.save('/roc-curve/steps', {run}); await io.save('/roc-curve/steps', {run});
for (const tag of tags[index]) { for (const tag of tags[index]) {
......
...@@ -14,17 +14,12 @@ ...@@ -14,17 +14,12 @@
* limitations under the License. * limitations under the License.
*/ */
import type {Data, Worker} from './types'; import type {TagData, Worker} from './types';
const DataTypes = ['csv', 'tsv']; const DataTypes = ['csv', 'tsv'];
const worker: Worker = async io => { const worker: Worker = async io => {
const components = await io.getData<string[]>('/components'); const {runs, tags} = await io.save<TagData>('/scalar/tags');
if (!components.includes('scalar')) {
return;
}
const {runs, tags} = await io.save<Data>('/scalar/tags');
const q = []; const q = [];
for (const [index, run] of runs.entries()) { for (const [index, run] of runs.entries()) {
for (const tag of tags[index]) { for (const tag of tags[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.
*/
import type {Sample, TagData, Worker} from './types';
const worker: Worker = async io => {
const {runs, tags} = await io.save<TagData>('/text/tags');
for (const [index, run] of runs.entries()) {
for (const tag of tags[index]) {
const list = (await io.save<Sample[]>('/text/list', {run, tag})) ?? [];
for (const [index, text] of list.entries()) {
await io.saveBinary('/text/text', {run, tag, index, ts: text.wallTime});
}
}
}
};
export default worker;
...@@ -18,13 +18,12 @@ import type IO from './io'; ...@@ -18,13 +18,12 @@ import type IO from './io';
export type Worker = (io: IO) => Promise<void>; export type Worker = (io: IO) => Promise<void>;
export type Data = { export interface TagData {
runs: string[]; runs: string[];
tags: string[][]; tags: string[][];
}; }
export type Embedding = { export interface Sample {
name: string; step: number;
shape: [number, number]; wallTime: number;
path: string; }
};
{ {
"name": "@visualdl/demo", "name": "@visualdl/demo",
"version": "2.1.5", "version": "2.2.0-1",
"description": "A platform to visualize the deep learning process and result.", "description": "A platform to visualize the deep learning process and result.",
"keywords": [ "keywords": [
"visualdl", "visualdl",
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
因为 它太大了无法显示 source diff 。你可以改为 查看blob
{ {
"name": "@visualdl/mock", "name": "@visualdl/mock",
"version": "2.1.5", "version": "2.2.0-1",
"description": "A platform to visualize the deep learning process and result.", "description": "A platform to visualize the deep learning process and result.",
"keywords": [ "keywords": [
"visualdl", "visualdl",
......
{ {
"name": "@visualdl/netron", "name": "@visualdl/netron",
"version": "2.1.5", "version": "2.2.0-1",
"description": "A platform to visualize the deep learning process and result.", "description": "A platform to visualize the deep learning process and result.",
"keywords": [ "keywords": [
"visualdl", "visualdl",
......
{ {
"name": "@visualdl/server", "name": "@visualdl/server",
"version": "2.1.5", "version": "2.2.0-1",
"description": "A platform to visualize the deep learning process and result.", "description": "A platform to visualize the deep learning process and result.",
"keywords": [ "keywords": [
"visualdl", "visualdl",
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
"ecosystem.config.d.ts" "ecosystem.config.d.ts"
], ],
"dependencies": { "dependencies": {
"@visualdl/core": "2.1.5", "@visualdl/core": "2.2.0-1",
"dotenv": "9.0.2", "dotenv": "9.0.2",
"enhanced-resolve": "5.8.2", "enhanced-resolve": "5.8.2",
"express": "4.17.1", "express": "4.17.1",
...@@ -48,14 +48,14 @@ ...@@ -48,14 +48,14 @@
"@types/enhanced-resolve": "3.0.6", "@types/enhanced-resolve": "3.0.6",
"@types/express": "4.17.11", "@types/express": "4.17.11",
"@types/node": "15.3.0", "@types/node": "15.3.0",
"@visualdl/mock": "2.1.5", "@visualdl/mock": "2.2.0-1",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"nodemon": "2.0.7", "nodemon": "2.0.7",
"ts-node": "9.1.1", "ts-node": "9.1.1",
"typescript": "4.2.4" "typescript": "4.2.4"
}, },
"optionalDependencies": { "optionalDependencies": {
"@visualdl/demo": "2.1.5" "@visualdl/demo": "2.2.0-1"
}, },
"engines": { "engines": {
"node": ">=12", "node": ">=12",
......
{ {
"name": "@visualdl/wasm", "name": "@visualdl/wasm",
"version": "2.1.5", "version": "2.2.0-1",
"title": "VisualDL", "title": "VisualDL",
"description": "A platform to visualize the deep learning process and result.", "description": "A platform to visualize the deep learning process and result.",
"keywords": [ "keywords": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册