/** * Copyright (c) 2017 ~ present NAVER Corp. * billboard.js project is licensed under the MIT license */ import {Axis} from "./axis.js"; import {ChartTypes, d3Selection, DataItem, PrimitiveArray} from "./types.js"; import {Chart} from "./chart.js"; import {IArcData, IData, IDataPoint, IDataRow} from "../src/ChartInternal/data/IData.js"; import { ArcOptions, AreaOptions, BarOptions, BubbleOptions, CandlestickOptions, DonutOptions, FunnelOptions, GaugeOptions, LineOptions, PieOptions, PolarOptions, RadarOptions, RadialGradientOptions, ScatterOptions, SplineOptions, TreemapOptions } from "./options.shape.js"; export type FormatFunction = ( this: Chart, v: any, id: string, i: number, texts: d3Selection ) => string; export type PositionFunction = ( this: Chart, type: "x" | "y", v: number, id: string, i: number, texts: d3Selection ) => number; export type DataEventElement = SVGElement | HTMLCanvasElement; export interface CanvasThemeSelectorStyle { [key: string]: string | number | number[] | null | undefined; } export interface CanvasThemeOptions { /** * Canvas drawing style overrides keyed by supported billboard.js SVG selectors. * * These selector keys are compatibility aliases for supported canvas primitives, * not a full DOM/CSS selector engine. Unsupported or per-data selectors are ignored. * See CANVAS_THEME_SELECTORS.md for the supported selector and property list. */ selectors?: Record; [key: string]: any; } export interface ChartOptions { /** * Specify the CSS selector or the element which the chart will be set to. D3 selection object can be specified also. * If other chart is set already, it will be replaced with the new one (only one chart can be set in one element). * - **NOTE:** In case of element doesn't exist or not specified, will add a `
` element to the body. */ bindto?: string | HTMLElement | d3Selection | null | { /** * Specify the element where chart will be drawn. */ element?: string | HTMLElement | d3Selection; /** * Specify the class name of bind element. * NOTE: When class name isn't bb, then you also need to update the default CSS to be rendered correctly. */ classname?: string; }; /** * Set chart background. */ background?: { /** * Specify the class name for background element. */ class?: string; /** * Specify the fill color for background element. (NOTE: Will be ignored if `imgUrl` option is set.) */ color?: string; /** * Specify the image url string for background. */ imgUrl?: string; }; boost?: { /** * Avoid setting inline styles for each shape elements. * - **NOTE:** * - Will append