| 54 | |
| 55 | |
| 56 | class GraphView extends ChartView implements RoamHostView { |
| 57 | |
| 58 | static readonly type = SERIES_TYPE_GRAPH; |
| 59 | readonly type = SERIES_TYPE_GRAPH; |
| 60 | |
| 61 | private _symbolDraw: SymbolDraw; |
| 62 | private _lineDraw: LineDraw; |
| 63 | |
| 64 | private _controller: RoamController; |
| 65 | |
| 66 | private _firstRender: boolean; |
| 67 | |
| 68 | private _model: GraphSeriesModel; |
| 69 | |
| 70 | private _api: ExtensionAPI; |
| 71 | |
| 72 | private _layoutTimeout: number; |
| 73 | |
| 74 | private _layouting: boolean; |
| 75 | |
| 76 | private _mainGroup: graphic.Group; |
| 77 | |
| 78 | private _active: boolean; |
| 79 | |
| 80 | init(ecModel: GlobalModel, api: ExtensionAPI) { |
| 81 | const symbolDraw = new SymbolDraw(); |
| 82 | const lineDraw = new LineDraw(); |
| 83 | const group = this.group; |
| 84 | const mainGroup = new graphic.Group(); |
| 85 | this._controller = new RoamController(api.getZr()); |
| 86 | |
| 87 | mainGroup.add(symbolDraw.group); |
| 88 | mainGroup.add(lineDraw.group); |
| 89 | group.add(mainGroup); |
| 90 | |
| 91 | this._symbolDraw = symbolDraw; |
| 92 | this._lineDraw = lineDraw; |
| 93 | |
| 94 | this._mainGroup = mainGroup; |
| 95 | |
| 96 | this._firstRender = true; |
| 97 | } |
| 98 | |
| 99 | render(seriesModel: GraphSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) { |
| 100 | const ownCoordSys = getOwnRoamViewCoordSys(seriesModel); |
| 101 | let isForceLayout = false; |
| 102 | |
| 103 | this._model = seriesModel; |
| 104 | this._api = api; |
| 105 | this._active = true; |
| 106 | const mainGroup = this._mainGroup; |
| 107 | |
| 108 | const thumbnailInfo = this._getThumbnailInfo(); |
| 109 | if (thumbnailInfo) { |
| 110 | thumbnailInfo.bridge.reset(api); |
| 111 | } |
| 112 | |
| 113 | const symbolDraw = this._symbolDraw; |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…