(style_dict, indices?)
| 485 | } |
| 486 | |
| 487 | clear_style(style_dict, indices?) { |
| 488 | // Function to clear the style of a dict on some or all the elements of the |
| 489 | // chart. If indices is null, clears the style on all elements. If |
| 490 | // not, clears on only the elements whose indices are matching. |
| 491 | let elements = this.pieSelection.selectAll('.slice'); |
| 492 | if (indices) { |
| 493 | elements = elements.filter((d, index) => { |
| 494 | return indices.indexOf(index) !== -1; |
| 495 | }); |
| 496 | } |
| 497 | const clearing_style = {}; |
| 498 | for (const key in style_dict) { |
| 499 | clearing_style[key] = null; |
| 500 | } |
| 501 | applyStyles(elements, clearing_style); |
| 502 | } |
| 503 | |
| 504 | set_style_on_elements(style, indices?) { |
| 505 | // If the index array is undefined or of length=0, exit the |
no test coverage detected