setColumnsByName turns columns on or off if their name contains the given string.
(nameContains string, on bool)
| 459 | // setColumnsByName turns columns on or off if their name contains |
| 460 | // the given string. |
| 461 | func (pl *PlotEditor) setColumnsByName(nameContains string, on bool) { //types:add |
| 462 | fr := pl.columnsFrame |
| 463 | for i, cli := range fr.Children { |
| 464 | if i < plotColumnsHeaderN { |
| 465 | continue |
| 466 | } |
| 467 | ci := i - plotColumnsHeaderN |
| 468 | cp := pl.Columns[ci] |
| 469 | if cp.Column == pl.Options.XAxis { |
| 470 | continue |
| 471 | } |
| 472 | if !strings.Contains(cp.Column, nameContains) { |
| 473 | continue |
| 474 | } |
| 475 | cp.On = on |
| 476 | cl := cli.(*core.Frame) |
| 477 | sw := cl.Child(0).(*core.Switch) |
| 478 | sw.SetChecked(cp.On) |
| 479 | } |
| 480 | pl.UpdatePlot() |
| 481 | pl.NeedsRender() |
| 482 | } |
| 483 | |
| 484 | // makeColumns makes the Plans for columns |
| 485 | func (pl *PlotEditor) makeColumns(p *tree.Plan) { |
nothing calls this directly
no test coverage detected