import { MarkType , AxisOrientation , ChartOptions , MarkEncodingKey , } from '@chart-parts/interfaces' ; import { AxisBuilder } from './AxisBuilder' ; import { ChartOptionsManager } from './ChartOptionsManager' ; import { MarkBuilder } from './MarkBuilder' ; import { SceneNodeBuilder } from './SceneNodeBuilder' ; category export function scene ( cb , opts ) { const optsManager = new ChartOptionsManager ( opts ) ; return new SceneNodeBuilder ( ) . mark ( group ( 'root' ) . role ( 'frame' ) . encode ( { [ MarkEncodingKey . zIndex ] : 0 , [ MarkEncodingKey . x ] : optsManager . paddingLeft , [ MarkEncodingKey . y ] : optsManager . paddingTop , [ MarkEncodingKey . width ] : optsManager . chartSpace . shape . width , [ MarkEncodingKey . height ] : optsManager . chartSpace . shape . height , } ) . child ( cb ) ) ; } param type category export function mark ( type ) { return new MarkBuilder ( type ) ; } param name category export function arc ( name ? ) { return markWithName ( MarkType . Arc , name ) ; } category param name export function area ( name ? ) { return markWithName ( MarkType . Area , name ) ; } category param name export function group ( name ? ) { return markWithName ( MarkType . Group , name ) ; } category param name export function image ( name ? ) { return markWithName ( MarkType . Image , name ) ; } category param name export function line ( name ? ) { return markWithName ( MarkType . Line , name ) ; } category param name export function path ( name ? ) { return markWithName ( MarkType . Path , name ) ; } category param name export function rect ( name ? ) { return markWithName ( MarkType . Rect , name ) ; } category param name export function rule ( name ? ) { return markWithName ( MarkType . Rule , name ) ; } category param name export function shape ( name ? ) { return markWithName ( MarkType . Shape , name ) ; } category param name export function symbol ( name ? ) { return markWithName ( MarkType . Symbol , name ) ; } category param name export function text ( name ? ) { return markWithName ( MarkType . Text , name ) ; } category param name export function trail ( name ? ) { return markWithName ( MarkType . Trail , name ) ; } function markWithName ( markType , name ? ) { const result = mark ( markType ) ; return name ? result . name ( name ) : result ; } param scale param orientation category export function axis ( scale , orientation ) { return new AxisBuilder ( scale , orientation ) ; }