Unverified Commit ef15fc81 authored by liuzhe-lz's avatar liuzhe-lz Committed by GitHub
Browse files

Bump node.js version to v16 (#3828)

parent b2225436
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -17,7 +17,6 @@
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier/react",
"prettier"
],
"rules": {
......@@ -29,6 +28,17 @@
"@typescript-eslint/no-use-before-define": [2, "nofunc"],
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-unused-vars": [2, { "argsIgnorePattern": "^_" }],
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": true,
"types": {
"{}": false,
"object": false,
"Function": false
}
}
],
"arrow-parens": [2, "as-needed"],
"no-inner-declarations": 0,
"no-empty": 2,
......@@ -45,4 +55,4 @@
"**/*.js"
]
}
}
\ No newline at end of file
}
'use strict';
const fs = require('fs');
const isWsl = require('is-wsl');
const path = require('path');
const webpack = require('webpack');
const resolve = require('resolve');
......@@ -11,9 +10,9 @@ const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin');
const TerserPlugin = require('terser-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const safePostCssParser = require('postcss-safe-parser');
const ManifestPlugin = require('webpack-manifest-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
//const safePostCssParser = require('postcss-safe-parser');
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const WorkboxWebpackPlugin = require('workbox-webpack-plugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
......@@ -94,20 +93,22 @@ module.exports = function(webpackEnv) {
options: {
// Necessary for external CSS imports to work
// https://github.com/facebook/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
require('postcss-preset-env')({
autoprefixer: {
flexbox: 'no-2009',
},
stage: 3,
}),
// Adds PostCSS Normalize as the reset css with default options,
// so that it honors browserslist config in package.json
// which in turn let's users customize the target behavior as per their needs.
postcssNormalize(),
],
//ident: 'postcss',
postcssOptions: {
plugins: () => [
require('postcss-flexbugs-fixes'),
require('postcss-preset-env')({
autoprefixer: {
flexbox: 'no-2009',
},
stage: 3,
}),
// Adds PostCSS Normalize as the reset css with default options,
// so that it honors browserslist config in package.json
// which in turn let's users customize the target behavior as per their needs.
postcssNormalize(),
],
},
sourceMap: isEnvProduction && shouldUseSourceMap,
},
},
......@@ -163,8 +164,6 @@ module.exports = function(webpackEnv) {
filename: isEnvProduction
? 'static/js/[name].[contenthash:8].js'
: isEnvDevelopment && 'static/js/bundle.js',
// TODO: remove this when upgrading to webpack 5
futureEmitAssets: true,
// There are also additional JS chunk files if you use code splitting.
chunkFilename: isEnvProduction
? 'static/js/[name].[contenthash:8].chunk.js'
......@@ -220,29 +219,23 @@ module.exports = function(webpackEnv) {
ascii_only: true,
},
},
// Use multi-process parallel running to improve the build speed
// Default number of concurrent runs: os.cpus().length - 1
// Disabled on WSL (Windows Subsystem for Linux) due to an issue with Terser
// https://github.com/webpack-contrib/terser-webpack-plugin/issues/21
parallel: !isWsl,
// Enable file caching
cache: true,
sourceMap: shouldUseSourceMap,
}),
// This is only used in production mode
new OptimizeCSSAssetsPlugin({
cssProcessorOptions: {
parser: safePostCssParser,
map: shouldUseSourceMap
? {
// `inline: false` forces the sourcemap to be output into a
// separate file
inline: false,
// `annotation: true` appends the sourceMappingURL to the end of
// the css file, helping the browser find the sourcemap
annotation: true,
}
: false,
new CssMinimizerPlugin({
minimizerOptions: {
processorOptions: {
//parser: safePostCssParser,
map: shouldUseSourceMap
? {
// `inline: false` forces the sourcemap to be output into a
// separate file
inline: false,
// `annotation: true` appends the sourceMappingURL to the end of
// the css file, helping the browser find the sourcemap
annotation: true,
}
: false,
},
},
}),
],
......@@ -552,7 +545,7 @@ module.exports = function(webpackEnv) {
// Generate a manifest file which contains a mapping of all asset filenames
// to their corresponding output file so that tools can pick it up without
// having to parse `index.html`.
new ManifestPlugin({
new WebpackManifestPlugin({
fileName: 'asset-manifest.json',
publicPath: publicPath,
generate: (seed, files) => {
......@@ -578,9 +571,9 @@ module.exports = function(webpackEnv) {
new WorkboxWebpackPlugin.GenerateSW({
clientsClaim: true,
exclude: [/\.map$/, /asset-manifest\.json$/],
importWorkboxFrom: 'cdn',
//importWorkboxFrom: 'cdn',
navigateFallback: publicUrl + '/index.html',
navigateFallbackBlacklist: [
navigateFallbackDenylist: [
// Exclude URLs starting with /_, as they're likely an API call
new RegExp('^/_'),
// Exclude URLs containing a dot, as they're likely a resource in
......@@ -614,16 +607,16 @@ module.exports = function(webpackEnv) {
].filter(Boolean),
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
module: 'empty',
dgram: 'empty',
dns: 'mock',
fs: 'empty',
http2: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty',
},
//node: {
// module: 'empty',
// dgram: 'empty',
// dns: 'mock',
// fs: 'empty',
// http2: 'empty',
// net: 'empty',
// tls: 'empty',
// child_process: 'empty',
//},
// Turn off performance processing because we utilize
// our own hints via the FileSizeReporter
performance: false,
......
......@@ -4,44 +4,40 @@
"license": "MIT",
"dependencies": {
"axios": "^0.21.1",
"babel-eslint": "10.0.1",
"babel-jest": "24.7.1",
"babel-loader": "8.0.5",
"babel-jest": "^27.0.2",
"babel-loader": "^8.2.2",
"babel-plugin-named-asset-import": "^0.3.2",
"babel-preset-react-app": "^8.0.0",
"case-sensitive-paths-webpack-plugin": "2.2.0",
"babel-preset-react-app": "^10.0.0",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
"copy-to-clipboard": "^3.0.8",
"css-loader": "2.1.1",
"d3": "^5.16.0",
"dotenv": "6.2.0",
"dotenv-expand": "4.2.0",
"css-loader": "^5.2.6",
"css-minimizer-webpack-plugin": "^3.0.1",
"d3": "^6.7.0",
"dotenv": "^10.0.0",
"dotenv-expand": "^5.1.0",
"echarts": "^5.0",
"echarts-for-react": "3.0.0",
"file-loader": "3.0.1",
"fs-extra": "7.0.1",
"html-webpack-plugin": "4.0.0-beta.5",
"identity-obj-proxy": "3.0.0",
"is-wsl": "^1.1.0",
"jest": "24.7.1",
"jest-environment-jsdom-fourteen": "0.1.0",
"jest-resolve": "24.7.1",
"jest-watch-typeahead": "0.3.0",
"echarts-for-react": "^3.0.0",
"file-loader": "^6.2.0",
"fs-extra": "^10.0.0",
"html-webpack-plugin": "^5.3.1",
"jest": "^27.0.4",
"jest-environment-jsdom-fourteen": "^1.0.1",
"jest-resolve": "^27.0.4",
"jest-watch-typeahead": "^0.6.4",
"json5": "^2.1.1",
"mini-css-extract-plugin": "0.5.0",
"monaco-editor": "^0.19.0",
"monaco-editor-webpack-plugin": "^1.8.1",
"node-sass": "^4.13.0",
"optimize-css-assets-webpack-plugin": "5.0.1",
"mini-css-extract-plugin": "^1.6.0",
"monaco-editor": "^0.25.0",
"monaco-editor-webpack-plugin": "^4.0.0",
"node-sass": "^6.0.0",
"parcoord-es": "^2.2.10",
"pnp-webpack-plugin": "1.2.1",
"postcss-flexbugs-fixes": "4.1.0",
"postcss-loader": "3.0.0",
"postcss-normalize": "7.0.1",
"postcss-preset-env": "6.6.0",
"postcss-safe-parser": "4.0.1",
"pnp-webpack-plugin": "^1.6.4",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-loader": "^6.1.0",
"postcss-normalize": "^10.0.0",
"postcss-preset-env": "^6.6.0",
"react": "^16.8.6",
"react-app-polyfill": "^1.0.0",
"react-dev-utils": "^9.0.0",
"react-dev-utils": "^11.0.4",
"react-dom": "^16.8.6",
"react-json-tree": "^0.11.2",
"react-monaco-editor": "^0.32.1",
......@@ -50,46 +46,47 @@
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-table": "^7.0.0-rc.15",
"resolve": "1.10.0",
"sass-loader": "7.1.0",
"semver": "6.0.0",
"style-loader": "0.23.1",
"terser-webpack-plugin": "1.2.3",
"url-loader": "1.1.2",
"webpack": "4.29.6",
"webpack-dev-server": "3.2.1",
"webpack-manifest-plugin": "2.0.4",
"workbox-webpack-plugin": "4.2.0"
"resolve": "^1.10.0",
"sass-loader": "^12.1.0",
"semver": "^7.3.5",
"style-loader": "^2.0.0",
"url-loader": "^4.1.1",
"webpack": "^5.39.0",
"webpack-dev-server": "^3.11.2",
"webpack-manifest-plugin": "^3.1.1",
"workbox-webpack-plugin": "^6.1.5"
},
"devDependencies": {
"@babel/core": "7.4.3",
"@babel/core": "^7.14.6",
"@babel/eslint-parser": "^7.14.5",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.14.5",
"@babel/runtime": "^7.14.6",
"@fluentui/react": "^7.135.0",
"@svgr/webpack": "4.1.0",
"@types/d3": "^5.7.2",
"@types/jest": "24.0.12",
"@types/json5": "^0.0.30",
"@types/node": "^10.14.2",
"@types/react": "16.8.15",
"@types/react-dom": "16.8.4",
"@typescript-eslint/eslint-plugin": "^2.11.0",
"@typescript-eslint/parser": "^2.11.0",
"concurrently": "^5.2.0",
"eslint": "^5.16.0",
"eslint-config-prettier": "^6.1.0",
"eslint-config-react-app": "^4.0.0",
"eslint-loader": "2.1.2",
"eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "2.16.0",
"eslint-plugin-jsx-a11y": "6.2.1",
"@svgr/webpack": "^5.5.0",
"@types/d3": "^6.7.0",
"@types/node": "^15.12.2",
"@types/react": "^16.8.15",
"@types/react-dom": "^16.8.4",
"@typescript-eslint/eslint-plugin": "^4.27.0",
"@typescript-eslint/parser": "^4.27.0",
"concurrently": "^6.2.0",
"eslint": "^7.28.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^6.0.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-flowtype": "^5.7.2",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "7.12.4",
"eslint-plugin-react-hooks": "^1.5.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"express": "^4.17.1",
"npx": "^10.2.0",
"prettier": "^1.18.2",
"prettier": "^2.3.1",
"stylelint": "^13.7.0",
"stylelint-config-standard": "^20.0.0",
"typescript": "^3.8.0"
"stylelint-config-standard": "^22.0.0",
"typescript": "^4.3.2"
},
"proxy": "http://localhost:12138",
"scripts": {
......@@ -109,15 +106,15 @@
],
"babel": {
"presets": [
"react-app"
"@babel/preset-react",
"@babel/preset-typescript"
]
},
"resolutions": {
"npm": ">=6.14.4",
"yargs": "~16.0.3",
"acorn": ">=8.0.4",
"node-forge": ">=0.10.0",
"y18n": ">=5.0.5",
"npm": ">=7.17.0",
"yargs": ">=17.0.1",
"acorn": ">=8.4.0",
"y18n": ">=5.0.8",
"serialize-javascript": ">=5.0.1"
},
"jest": {
......
......@@ -8,5 +8,5 @@ module.exports = {
singleQuote: true,
eslintIntegration: true,
jsxSingleQuote: true,
endOfline: 'lf'
endOfLine: process.platform === 'win32' ? 'auto' : 'lf'
};
......@@ -22,7 +22,7 @@ const webpack = require('webpack');
const configFactory = require('../config/webpack.config');
const paths = require('../config/paths');
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
const formatWebpackMessages = require('./formatWebpackMessages');
const printHostingInstructions = require('react-dev-utils/printHostingInstructions');
const FileSizeReporter = require('react-dev-utils/FileSizeReporter');
const printBuildError = require('react-dev-utils/printBuildError');
......
// FIXME: This file is copied from react-dev-utils master branch. Waiting for its next release.
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
const friendlySyntaxErrorLabel = 'Syntax error:';
function isLikelyASyntaxError(message) {
return message.indexOf(friendlySyntaxErrorLabel) !== -1;
}
// Cleans up webpack error messages.
function formatMessage(message) {
let lines = [];
if (typeof message === 'string') {
lines = message.split('\n');
} else if ('message' in message) {
lines = message['message'].split('\n');
} else if (Array.isArray(message)) {
message.forEach(message => {
if ('message' in message) {
lines = message['message'].split('\n');
}
});
}
// Strip webpack-added headers off errors/warnings
// https://github.com/webpack/webpack/blob/master/lib/ModuleError.js
lines = lines.filter(line => !/Module [A-z ]+\(from/.test(line));
// Transform parsing error into syntax error
// TODO: move this to our ESLint formatter?
lines = lines.map(line => {
const parsingError = /Line (\d+):(?:(\d+):)?\s*Parsing error: (.+)$/.exec(
line
);
if (!parsingError) {
return line;
}
const [, errorLine, errorColumn, errorMessage] = parsingError;
return `${friendlySyntaxErrorLabel} ${errorMessage} (${errorLine}:${errorColumn})`;
});
message = lines.join('\n');
// Smoosh syntax errors (commonly found in CSS)
message = message.replace(
/SyntaxError\s+\((\d+):(\d+)\)\s*(.+?)\n/g,
`${friendlySyntaxErrorLabel} $3 ($1:$2)\n`
);
// Clean up export errors
message = message.replace(
/^.*export '(.+?)' was not found in '(.+?)'.*$/gm,
`Attempted import error: '$1' is not exported from '$2'.`
);
message = message.replace(
/^.*export 'default' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm,
`Attempted import error: '$2' does not contain a default export (imported as '$1').`
);
message = message.replace(
/^.*export '(.+?)' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm,
`Attempted import error: '$1' is not exported from '$3' (imported as '$2').`
);
lines = message.split('\n');
// Remove leading newline
if (lines.length > 2 && lines[1].trim() === '') {
lines.splice(1, 1);
}
// Clean up file name
lines[0] = lines[0].replace(/^(.*) \d+:\d+-\d+$/, '$1');
// Cleans up verbose "module not found" messages for files and packages.
if (lines[1] && lines[1].indexOf('Module not found: ') === 0) {
lines = [
lines[0],
lines[1]
.replace('Error: ', '')
.replace('Module not found: Cannot find file:', 'Cannot find file:'),
];
}
// Add helpful message for users trying to use Sass for the first time
if (lines[1] && lines[1].match(/Cannot find module.+sass/)) {
lines[1] = 'To import Sass files, you first need to install sass.\n';
lines[1] +=
'Run `npm install sass` or `yarn add sass` inside your workspace.';
}
message = lines.join('\n');
// Internal stacks are generally useless so we strip them... with the
// exception of stacks containing `webpack:` because they're normally
// from user code generated by webpack. For more information see
// https://github.com/facebook/create-react-app/pull/1050
message = message.replace(
/^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm,
''
); // at ... ...:x:y
message = message.replace(/^\s*at\s<anonymous>(\n|$)/gm, ''); // at <anonymous>
lines = message.split('\n');
// Remove duplicated newlines
lines = lines.filter(
(line, index, arr) =>
index === 0 || line.trim() !== '' || line.trim() !== arr[index - 1].trim()
);
// Reassemble the message
message = lines.join('\n');
return message.trim();
}
function formatWebpackMessages(json) {
const formattedErrors = json.errors.map(formatMessage);
const formattedWarnings = json.warnings.map(formatMessage);
const result = { errors: formattedErrors, warnings: formattedWarnings };
if (result.errors.some(isLikelyASyntaxError)) {
// If there are any syntax errors, show just them.
result.errors = result.errors.filter(isLikelyASyntaxError);
}
return result;
}
module.exports = formatWebpackMessages;
......@@ -362,14 +362,8 @@ class Experiment extends React.Component<{}, ExpListState> {
private getSelectedData(type: string, date: Date | null | undefined): void {
if (date !== null && date !== undefined) {
const {
selectedStatus,
selectedPlatform,
selectedStartDate,
selectedEndDate,
searchSource,
sortInfo
} = this.state;
const { selectedStatus, selectedPlatform, selectedStartDate, selectedEndDate, searchSource, sortInfo } =
this.state;
const hasPlatform = selectedPlatform === '' ? false : true;
// filter status, platform
......
......@@ -32,13 +32,7 @@ const filterByStatusOrPlatform = (
};
function fillOptions(arr: string[]): any {
const list: Array<object> = [];
arr.map(item => {
list.push({ key: item, text: item });
});
return list;
return arr.map(item => ({ key: item, text: item }));
}
function getSortedSource(source: AllExperimentList[], sortInfo: SortInfo): AllExperimentList[] {
......
......@@ -20,11 +20,11 @@ interface SimpleColumn {
name: string; // name to display
}
interface CheckBoxItems {
label: string;
checked: boolean;
onChange: () => void;
}
//interface CheckBoxItems {
// label: string;
// checked: boolean;
// onChange: () => void;
//}
class ChangeColumnComponent extends React.Component<ChangeColumnProps, ChangeColumnState> {
constructor(props: ChangeColumnProps) {
......
......@@ -51,7 +51,7 @@ class Customize extends React.Component<CustomizeProps, CustomizeState> {
// get user edited hyperParameter, ps: will change data type if you modify the input val
const customized = JSON.parse(JSON.stringify(copyTrialParameter));
// changeMap: user changed keys: values
changeMap.forEach(function(value, key) {
changeMap.forEach(function (value, key) {
customized[key] = value;
});
......
......@@ -27,9 +27,8 @@ export const EditExperimentParam = (): any => {
const hideSucceedInfo = useCallback(() => {
setShowSucceedInfo(false);
}, []);
const { title, field, editType, maxExecDuration, maxTrialNum, trialConcurrency, updateOverviewPage } = useContext(
EditExpeParamContext
);
const { title, field, editType, maxExecDuration, maxTrialNum, trialConcurrency, updateOverviewPage } =
useContext(EditExpeParamContext);
const originMaxDurationStr = EXPERIMENT.profile.params.maxExperimentDuration;
const { maxDurationUnit, changeMaxDurationUnit } = useContext(AppContext);
const [unit, setUnit] = useState(maxDurationUnit);
......@@ -109,7 +108,6 @@ export const EditExperimentParam = (): any => {
// rest api, modify trial concurrency value
try {
const res = await axios.put(`${MANAGER_IP}/experiment`, newProfile, {
// eslint-disable-next-line @typescript-eslint/camelcase
params: { update_type: editType }
});
if (res.status === 200) {
......
......@@ -204,10 +204,12 @@ class SuccessTable extends React.Component<SuccessTableProps, SuccessTableState>
}
return (
<Sticky stickyPosition={StickyPositionType.Header} isScrollSynced>
{// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
defaultRender!({
...props
})}
{
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
defaultRender!({
...props
})
}
</Sticky>
);
};
......
......@@ -98,37 +98,39 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> {
)}
</PivotItem>
<PivotItem headerText='Log' key='2' itemIcon='M365InvoicingLogo'>
{// FIXME: this should not be handled in web UI side
EXPERIMENT.trainingServicePlatform !== 'local' ? (
<PaiTrialLog
logStr={logPathRow}
id={trialId}
logCollection={EXPERIMENT.logCollectionEnabled}
/>
) : (
<div>
<TrialLog logStr={logPathRow} id={trialId} />
{/* view each trial log in drawer*/}
<div id='trialog'>
<div className='copy' style={{ marginTop: 15 }}>
<PrimaryButton
onClick={this.openTrialLog.bind(this, 'TRIAL_LOG')}
text='View trial log'
/>
<PrimaryButton
onClick={this.openTrialLog.bind(this, 'TRIAL_ERROR')}
text='View trial error'
styles={{ root: { marginLeft: 15 } }}
/>
<PrimaryButton
onClick={this.openTrialLog.bind(this, 'TRIAL_STDOUT')}
text='View trial stdout'
styles={{ root: { marginLeft: 15 } }}
/>
{
// FIXME: this should not be handled in web UI side
EXPERIMENT.trainingServicePlatform !== 'local' ? (
<PaiTrialLog
logStr={logPathRow}
id={trialId}
logCollection={EXPERIMENT.logCollectionEnabled}
/>
) : (
<div>
<TrialLog logStr={logPathRow} id={trialId} />
{/* view each trial log in drawer*/}
<div id='trialog'>
<div className='copy' style={{ marginTop: 15 }}>
<PrimaryButton
onClick={this.openTrialLog.bind(this, 'TRIAL_LOG')}
text='View trial log'
/>
<PrimaryButton
onClick={this.openTrialLog.bind(this, 'TRIAL_ERROR')}
text='View trial error'
styles={{ root: { marginLeft: 15 } }}
/>
<PrimaryButton
onClick={this.openTrialLog.bind(this, 'TRIAL_STDOUT')}
text='View trial stdout'
styles={{ root: { marginLeft: 15 } }}
/>
</div>
</div>
</div>
</div>
)}
)
}
</PivotItem>
</Pivot>
</Stack>
......
......@@ -15,7 +15,7 @@ const DETAILTABS = (
const NNILOGO = (
<NavLink to='/oview'>
<img src={require('../../static/img/logo.png')} alt='NNI logo' style={{ height: 40 }} />
<img src='/logo.png' alt='NNI logo' style={{ height: 40 }} />
</NavLink>
);
......
......@@ -86,7 +86,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
trigger: 'item',
enterable: true,
confine: true,
formatter: function(data: TooltipForIntermediate): React.ReactNode {
formatter: function (data: TooltipForIntermediate): React.ReactNode {
const trialId = data.seriesName;
let parameters = {};
let trialNum = 0;
......
......@@ -89,13 +89,8 @@ class Para extends React.Component<ParaProps, ParaState> {
}
render(): React.ReactNode {
const {
selectedPercent,
noChart,
customizeColumnsDialogVisible,
availableDimensions,
chosenDimensions
} = this.state;
const { selectedPercent, noChart, customizeColumnsDialogVisible, availableDimensions, chosenDimensions } =
this.state;
return (
<div className='parameter'>
......@@ -314,15 +309,9 @@ class Para extends React.Component<ParaProps, ParaState> {
if (axis.scale === 'ordinal') {
if (axis.nested) {
// TODO: handle nested entries
scaleInst = d3
.scalePoint()
.domain(Array.from(axis.domain.keys()))
.padding(0.2);
scaleInst = d3.scalePoint().domain(Array.from(axis.domain.keys())).padding(0.2);
} else {
scaleInst = d3
.scalePoint()
.domain(axis.domain)
.padding(0.2);
scaleInst = d3.scalePoint().domain(axis.domain).padding(0.2);
}
} else if (axis.scale === 'log') {
scaleInst = d3.scaleLog().domain(padLog(axis.domain));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment