(
seriesModel: GraphSeriesModel,
api: ExtensionAPI,
symbolDraw: SymbolDraw,
lineDraw: LineDraw
)
| 363 | } |
| 364 | |
| 365 | private _renderThumbnail( |
| 366 | seriesModel: GraphSeriesModel, |
| 367 | api: ExtensionAPI, |
| 368 | symbolDraw: SymbolDraw, |
| 369 | lineDraw: LineDraw |
| 370 | ) { |
| 371 | const info = this._getThumbnailInfo(); |
| 372 | if (!info) { |
| 373 | return; |
| 374 | } |
| 375 | |
| 376 | const bridgeGroup = new graphic.Group(); |
| 377 | const symbolNodes = symbolDraw.group.children(); |
| 378 | const lineNodes = lineDraw.group.children(); |
| 379 | |
| 380 | const lineGroup = new graphic.Group(); |
| 381 | const symbolGroup = new graphic.Group(); |
| 382 | bridgeGroup.add(symbolGroup); |
| 383 | bridgeGroup.add(lineGroup); |
| 384 | |
| 385 | // TODO: reuse elements for performance in large graph? |
| 386 | for (let i = 0; i < symbolNodes.length; i++) { |
| 387 | const node = symbolNodes[i]; |
| 388 | const sub = (node as graphic.Group).children()[0]; |
| 389 | const x = (node as Symbol).x; |
| 390 | const y = (node as Symbol).y; |
| 391 | const subShape = clone((sub as graphic.Path).shape); |
| 392 | const shape = extend(subShape, { |
| 393 | width: sub.scaleX, |
| 394 | height: sub.scaleY, |
| 395 | x: x - sub.scaleX / 2, |
| 396 | y: y - sub.scaleY / 2 |
| 397 | }); |
| 398 | const style = clone((sub as graphic.Path).style); |
| 399 | const subThumbnail = new (sub as any).constructor({ |
| 400 | shape, |
| 401 | style, |
| 402 | z2: 151 |
| 403 | }); |
| 404 | symbolGroup.add(subThumbnail); |
| 405 | } |
| 406 | |
| 407 | for (let i = 0; i < lineNodes.length; i++) { |
| 408 | const node = lineNodes[i]; |
| 409 | const line = (node as graphic.Group).children()[0]; |
| 410 | const style = clone((line as ECLinePath).style); |
| 411 | const shape = clone((line as ECLinePath).shape); |
| 412 | const lineThumbnail = new ECLinePath({ |
| 413 | style, |
| 414 | shape, |
| 415 | z2: 151 |
| 416 | }); |
| 417 | lineGroup.add(lineThumbnail); |
| 418 | } |
| 419 | |
| 420 | info.bridge.renderContent({ |
| 421 | api, |
| 422 | roamType: seriesModel.get('roam'), |
no test coverage detected