MCPcopy Index your code
hub / github.com/microsoft/SandDance / vegaTimeFormat

Function vegaTimeFormat

packages/sanddance/src/date.ts:45–63  ·  view source on GitHub ↗
(values: [number, number][], d3TimeFormat: string)

Source from the content-addressed store, hash-verified

43}
44
45function vegaTimeFormat(values: [number, number][], d3TimeFormat: string) {
46 const name = 'timeFormat';
47 const as = 'output';
48 const spec: Spec = {
49 $schema: 'https://vega.github.io/schema/vega/v3.json',
50 data: [{
51 name,
52 values,
53 transform: [{
54 type: 'formula',
55 expr: `timeFormat(datum[0], '${d3TimeFormat}') + ' - ' + timeFormat(datum[1], '${d3TimeFormat}')`,
56 as,
57 }],
58 }],
59 };
60 const runtime = VegaDeckGl.base.vega.parse(spec);
61 const view = new VegaDeckGl.ViewGl(runtime).run();
62 return view.data(name).map(row => row[as]);
63}

Callers 1

makeDateRangeFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected