feat: use essex config in d3
This commit is contained in:
Родитель
32bc1cba64
Коммит
956e316ff3
|
@ -26,6 +26,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@essex/scripts": "^20.0.0",
|
||||
"@essex/tsconfig-base": "^1.0.0",
|
||||
"@types/d3-axis": "^1.0.16",
|
||||
"@types/d3-selection": "^1.4.3",
|
||||
"@types/node": "^14.18.5"
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { Theme } from '@thematic/core'
|
||||
import { Axis } from 'd3-axis'
|
||||
import { Selection } from 'd3-selection'
|
||||
import type { Theme } from '@thematic/core'
|
||||
import type { Axis } from 'd3-axis'
|
||||
import type { Selection } from 'd3-selection'
|
||||
import {
|
||||
svg as svgCall,
|
||||
rect as rectCall,
|
||||
|
@ -44,7 +44,7 @@ export interface PlotAreaOptions extends ChartOptions {
|
|||
}
|
||||
|
||||
function getSelectionOptions(
|
||||
selection: Selection<Element, any, Element, any>,
|
||||
_selection: Selection<Element, any, Element, any>,
|
||||
options?: SelectionOptions,
|
||||
): SelectionOptions {
|
||||
const _on = (options && options.on) || {}
|
||||
|
@ -64,15 +64,15 @@ function getChartOptions(
|
|||
const height = h || +selection.attr('height') || 0
|
||||
const sOpts = getSelectionOptions(selection, options)
|
||||
return {
|
||||
on: sOpts.on,
|
||||
on: sOpts.on ?? {},
|
||||
attr: {
|
||||
// stick these on for application later
|
||||
width,
|
||||
height,
|
||||
...sOpts.attr,
|
||||
},
|
||||
classed: sOpts.classed,
|
||||
style: sOpts.style,
|
||||
classed: sOpts.classed ?? {},
|
||||
style: sOpts.style ?? {},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,15 +104,15 @@ function getPlotAreaOptions(
|
|||
marginBottom,
|
||||
marginLeft,
|
||||
marginRight,
|
||||
on: sOpts.on,
|
||||
on: sOpts.on ?? {},
|
||||
attr: {
|
||||
// stick these on for application later
|
||||
width,
|
||||
height,
|
||||
...sOpts.attr,
|
||||
},
|
||||
classed: sOpts.classed,
|
||||
style: sOpts.style,
|
||||
classed: sOpts.classed ?? {},
|
||||
style: sOpts.style ?? {},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { Theme, ScaleType, SelectionState } from '@thematic/core'
|
||||
import { Selection } from 'd3-selection'
|
||||
import type { Selection } from 'd3-selection'
|
||||
|
||||
/**
|
||||
* Creates a d3-compatible nominal scale using the theme.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import {
|
||||
import type {
|
||||
Chart,
|
||||
SVGMark,
|
||||
PlotArea,
|
||||
|
@ -15,7 +15,7 @@ import {
|
|||
Link,
|
||||
Text,
|
||||
} from '@thematic/core'
|
||||
import { Selection } from 'd3-selection'
|
||||
import type { Selection } from 'd3-selection'
|
||||
|
||||
export function svg(
|
||||
selection: Selection<Element, any, Element, any>,
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "@essex/tsconfig-base",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib",
|
||||
"strict": false,
|
||||
"resolveJsonModule": true,
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
"name": "@thematic/fluent",
|
||||
"version": "2.1.0",
|
||||
"license": "MIT",
|
||||
"main": "src/index.ts",
|
||||
"publishConfig": {
|
||||
"main": "dist/cjs/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
"types": "dist/types/index.d.ts"
|
||||
"main": "dist/cjs/index.js",
|
||||
"types": "dist/types/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist/esm/index.mjs",
|
||||
"require": "./dist/cjs/index.js",
|
||||
"types": "./dist/types/index.d.ts"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -2824,6 +2824,7 @@ __metadata:
|
|||
resolution: "@thematic/d3@workspace:packages/d3"
|
||||
dependencies:
|
||||
"@essex/scripts": ^20.0.0
|
||||
"@essex/tsconfig-base": ^1.0.0
|
||||
"@thematic/core": "workspace:packages/core"
|
||||
"@types/d3-axis": ^1.0.16
|
||||
"@types/d3-selection": ^1.4.3
|
||||
|
|
Загрузка…
Ссылка в новой задаче