(options: MarkStagerOptions, stage: Stage, scene: Scene, x: number, y: number, groupType: GroupType)
| 9 | import { zSwap } from '../zaxis'; |
| 10 | |
| 11 | const markStager: MarkStager = (options: MarkStagerOptions, stage: Stage, scene: Scene, x: number, y: number, groupType: GroupType) => { |
| 12 | |
| 13 | base.vega.sceneVisit(scene, function (item: SceneLine) { |
| 14 | const x1 = item.x || 0; |
| 15 | const y1 = item.y || 0; |
| 16 | const x2 = item.x2 != null ? item.x2 : x1; |
| 17 | const y2 = item.y2 != null ? item.y2 : y1; |
| 18 | |
| 19 | const lineItem = styledLine(x1 + x, y1 + y, x2 + x, y2 + y, item.stroke, item.strokeWidth); |
| 20 | |
| 21 | if (item.mark.role === 'axis-tick') { |
| 22 | if (options.currAxis.role === 'z') { |
| 23 | zSwap(lineItem.sourcePosition); |
| 24 | zSwap(lineItem.targetPosition); |
| 25 | } |
| 26 | options.currAxis.ticks.push(lineItem); |
| 27 | } else if (item.mark.role === 'axis-domain') { |
| 28 | if (options.currAxis.role === 'z') { |
| 29 | zSwap(lineItem.sourcePosition); |
| 30 | zSwap(lineItem.targetPosition); |
| 31 | } |
| 32 | options.currAxis.domain = lineItem; |
| 33 | } else { |
| 34 | stage.gridLines.push(lineItem); |
| 35 | } |
| 36 | }); |
| 37 | }; |
| 38 | |
| 39 | function styledLine(x1: number, y1: number, x2: number, y2: number, stroke: string, strokeWidth: number) { |
| 40 | const line: StyledLine = { |
nothing calls this directly
no test coverage detected