import { Color } from '@thematic/color' ; import { SVGChrome , ChromeText , PlotArea , AxisLine , AxisTicks , AxisTickLabels , AxisTitle , GridLines , Tooltip , SVGSpec , AxisTicksSpec , PlotAreaSpec , GridLinesSpec , AxisLineSpec , TextSpec , AxisTitleSpec , AxisTickLabelsSpec , TooltipSpec , } from '../types' ; function SVGChromeImpl ( spec ) { return { fill : ( ) => new Color ( spec . fill ! , spec . fillOpacity ) , fillOpacity : ( ) => spec . fillOpacity ! , stroke : ( ) => new Color ( spec . stroke ! , spec . strokeOpacity ) , strokeOpacity : ( ) => spec . strokeOpacity ! , strokeWidth : ( ) => spec . strokeWidth ! , } ; } export function PlotAreaImpl ( spec ) { return SVGChromeImpl ( spec ) ; } export function GridLinesImpl ( spec ) { return SVGChromeImpl ( spec ) ; } export function AxisLineImpl ( spec ) { return SVGChromeImpl ( spec ) ; } export function AxisTicksImpl ( spec ) { return { ... SVGChromeImpl ( spec ) , innerSize : ( ) => spec . innerSize ! , outerSize : ( ) => spec . outerSize ! , } ; } export function ChromeTextImpl ( spec ) { return { ... SVGChromeImpl ( spec ) , fontFamily : ( ) => spec . fontFamily ! , fontWeight : ( ) => spec . fontWeight ! , fontSize : ( ) => spec . fontSize ! , } ; } export function AxisTitleImpl ( spec ) { return ChromeTextImpl ( spec ) ; } export function AxisTickLabelsImpl ( spec ) { return { ... ChromeTextImpl ( spec ) , padding : ( ) => spec . padding ! , } ; } export function TooltipImpl ( spec ) { return SVGChromeImpl ( spec ) ; }