Class: D3Pie

D3Pie()

new D3Pie()

Subsystem rendering 2d pie chart in an svg div.

D3Pie only save drawn pie chart with D3, then save the domId in component CanvTex, let Thrender create the plane object.
See Thrender.createObj3s AssetType.DomCanvas branch.

reference: https://observablehq.com/@d3/pie-chart

Source:

Members

(static) svguuid

For generating Pie object uuid.

Source:

Methods

(static) debugPie3(ecs, options, json)

Generate a debugging object (pie) for hard coded parameters.

Parameters:
Name Type Description
ecs ECS
options Object

igonered

json Object

the data to draw the canvas - debugPie3 didn't touched

Source:

(static) drawPie(cmpCanv, json, options)

Draw a d3 pie, to cmpCanv.domId.

Parameters:
Name Type Description
cmpCanv Cavnas
json Object.<{rows: Array, columns: Array}>

e.g.
{rows: [{browser: "name", percent: "10.2"}],
columns: ["browser", "percent"]
}

options Object

{wh: { width, height }, xy: [x, y], color: ['#123456', ...]}

Source:

(static) pies(ecs, json, options)

create pies

Parameters:
Name Type Description
ecs ECS
json Object

{pie: [p]},
where
p: {pivot, rows, columns}, pivot is the grid index.
vectors: [], hi-dimensional vectors, with last dimesion as value.

options Object
Source:

(static) svgUId() → {String}

Get a uuid.

Source:
Returns:

3pie-id

Type
String

onMouse(cmd, e)

Handle mouse cmd.

Parameters:
Name Type Description
cmd String
e Event
Source:

update(tick, entities)

Parameters:
Name Type Description
tick int
entities Array.<Entity>
Source:

D3Pie(ecs, options, json)

new D3Pie(ecs, options, json)

Parameters:
Name Type Description
ecs ECS
options Object

options.stub: html div id for internal rendering buffer, must provided and must before sacne canvas. options.x: texture start offset x
options.y: texture start offset y
options.chart: the json chart section defining chart grid space, {domain, range, grid, grid-space}

json Array

[{pivot, rows, columns}]

Source:

Members

(static) svguuid

For generating Pie object uuid.

Source:

Methods

(static) debugPie3(ecs, options, json)

Generate a debugging object (pie) for hard coded parameters.

Parameters:
Name Type Description
ecs ECS
options Object

igonered

json Object

the data to draw the canvas - debugPie3 didn't touched

Source:

(static) drawPie(cmpCanv, json, options)

Draw a d3 pie, to cmpCanv.domId.

Parameters:
Name Type Description
cmpCanv Cavnas
json Object.<{rows: Array, columns: Array}>

e.g.
{rows: [{browser: "name", percent: "10.2"}],
columns: ["browser", "percent"]
}

options Object

{wh: { width, height }, xy: [x, y], color: ['#123456', ...]}

Source:

(static) pies(ecs, json, options)

create pies

Parameters:
Name Type Description
ecs ECS
json Object

{pie: [p]},
where
p: {pivot, rows, columns}, pivot is the grid index.
vectors: [], hi-dimensional vectors, with last dimesion as value.

options Object
Source:

(static) svgUId() → {String}

Get a uuid.

Source:
Returns:

3pie-id

Type
String

onMouse(cmd, e)

Handle mouse cmd.

Parameters:
Name Type Description
cmd String
e Event
Source:

update(tick, entities)

Parameters:
Name Type Description
tick int
entities Array.<Entity>
Source: