mirror of
https://gitee.com/antv/g6.git
synced 2024-12-02 03:38:20 +08:00
refactor(plugin):add tsconfig
This commit is contained in:
parent
a550fcdc8d
commit
8eab337960
6
packages/pc-plugins/.fatherrc.js
Normal file
6
packages/pc-plugins/.fatherrc.js
Normal file
@ -0,0 +1,6 @@
|
||||
export default {
|
||||
entry: './src/index.ts',
|
||||
esm: 'babel',
|
||||
cjs: 'babel',
|
||||
};
|
||||
|
55
packages/pc-plugins/.npmignore
Normal file
55
packages/pc-plugins/.npmignore
Normal file
@ -0,0 +1,55 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log
|
||||
.DS_Store
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# Dependency directories
|
||||
node_modules
|
||||
**/node_modules
|
||||
**/lib
|
||||
**/es
|
||||
jspm_packages/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
# IDE
|
||||
.idea
|
||||
|
||||
# build
|
||||
lib
|
||||
build
|
||||
|
||||
# lock
|
||||
package-lock.json
|
||||
|
||||
|
||||
# yarn-lock
|
||||
yarn.lock
|
||||
|
||||
|
||||
# ignore dist files
|
||||
.vscode/
|
||||
src
|
||||
jest.config.js
|
||||
.fatherrc.js
|
||||
__mock__
|
||||
public
|
||||
tsconfig.json
|
@ -15,7 +15,8 @@
|
||||
"@antv/g-svg": "^0.5.2",
|
||||
"@antv/g6": "*",
|
||||
"@antv/g6-core": "*",
|
||||
"@antv/matrix-util": "^3.0.3",
|
||||
"@antv/matrix-util": "^2.0.7",
|
||||
"@antv/scale": "^0.3.4",
|
||||
"@antv/util": "^2.0.9",
|
||||
"insert-css": "^2.0.0"
|
||||
},
|
||||
@ -24,5 +25,8 @@
|
||||
"license": "ISC",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"father": "^2.30.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,23 +1,23 @@
|
||||
// import Grid from './grid';
|
||||
// import Menu from './menu';
|
||||
// import Minimap from './minimap';
|
||||
// import Bundling from './bundling';
|
||||
// import Fisheye from './fisheye';
|
||||
// import ToolBar from './toolBar';
|
||||
// import Tooltip from './tooltip';
|
||||
// import TimeBar from './timeBar';
|
||||
// import ImageMinimap from './imageMinimap';
|
||||
// import EdgeFilterLens from './edgeFilterLens';
|
||||
import Grid from './grid';
|
||||
import Menu from './menu';
|
||||
import Minimap from './minimap';
|
||||
import Bundling from './bundling';
|
||||
import Fisheye from './fisheye';
|
||||
import ToolBar from './toolBar';
|
||||
import Tooltip from './tooltip';
|
||||
import TimeBar from './timeBar';
|
||||
import ImageMinimap from './imageMinimap';
|
||||
import EdgeFilterLens from './edgeFilterLens';
|
||||
|
||||
// export default {
|
||||
// Menu,
|
||||
// Grid,
|
||||
// Minimap,
|
||||
// Bundling,
|
||||
// ToolBar,
|
||||
// Tooltip,
|
||||
// Fisheye,
|
||||
// TimeBar,
|
||||
// ImageMinimap,
|
||||
// EdgeFilterLens
|
||||
// };
|
||||
export default {
|
||||
Menu,
|
||||
Grid,
|
||||
Minimap,
|
||||
Bundling,
|
||||
ToolBar,
|
||||
Tooltip,
|
||||
Fisheye,
|
||||
TimeBar,
|
||||
ImageMinimap,
|
||||
EdgeFilterLens,
|
||||
};
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { Canvas as GCanvas } from '@antv/g-canvas';
|
||||
import { Canvas as GSVGCanvas } from '@antv/g-svg';
|
||||
import Base, { IPluginBaseConfig } from '../../base';
|
||||
import Base, { IPluginBaseConfig } from '../base';
|
||||
import { isString, isNil, each, debounce } from '@antv/util';
|
||||
import { createDom, modifyCSS } from '@antv/dom-util';
|
||||
import { Graph } from '@antv/g6';
|
||||
import { Matrix, ShapeStyle } from '@antv/g6-core/es/types';
|
||||
import { Matrix, ShapeStyle } from '@antv/g6-core';
|
||||
import { transform } from '@antv/matrix-util';
|
||||
import { Point } from '@antv/g-math/lib/types';
|
||||
import { Event as GraphEvent } from '@antv/g-base';
|
||||
@ -26,6 +26,7 @@ interface MiniMapConfig extends IPluginBaseConfig {
|
||||
}
|
||||
|
||||
export default class MiniMap extends Base {
|
||||
this: Graph;
|
||||
public getDefaultCfgs(): MiniMapConfig {
|
||||
return {
|
||||
container: null,
|
||||
|
@ -10,7 +10,7 @@ import TrendTimeBar, { SliderOption } from './trendTimeBar';
|
||||
import TimeBarSlice, { TimeBarSliceOption } from './timeBarSlice';
|
||||
import { IGraph } from '@antv/g6/es/interface/graph';
|
||||
import { VALUE_CHANGE } from './constant';
|
||||
import { GraphData, IG6GraphEvent, ShapeStyle, TimeBarType } from '@antv/g6-core/es/types';
|
||||
import { GraphData, IG6GraphEvent, ShapeStyle, TimeBarType } from '@antv/g6-core';
|
||||
import { Interval } from './trend';
|
||||
import { ControllerCfg } from './controllerBtn';
|
||||
import { isString } from '@antv/util';
|
||||
@ -291,9 +291,9 @@ export default class TimeBar extends Base {
|
||||
});
|
||||
|
||||
// 时间轴的值发生改变的事件
|
||||
graph.on(VALUE_CHANGE, (evt: Callback) => {
|
||||
graph.on(VALUE_CHANGE, (e: Partial<Callback>) => {
|
||||
// 范围变化
|
||||
this.filterData(evt);
|
||||
this.filterData(e);
|
||||
});
|
||||
}
|
||||
|
||||
|
17
packages/pc-plugins/tsconfig.json
Normal file
17
packages/pc-plugins/tsconfig.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"allowJs": true,
|
||||
"declaration": true,
|
||||
"target": "es2015",
|
||||
"moduleResolution": "node",
|
||||
"jsx": "react",
|
||||
"resolveJsonModule": true,
|
||||
"noImplicitAny": false,
|
||||
"lib": ["dom", "esnext"],
|
||||
"module": "esnext",
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
Loading…
Reference in New Issue
Block a user