This commit is contained in:
Chris Trevino 2022-02-09 12:11:25 -08:00
Родитель 32bc1cba64
Коммит 956e316ff3
7 изменённых файлов: 23 добавлений и 21 удалений

Просмотреть файл

@ -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