MCPcopy Index your code
hub / github.com/bqplot/bqplot / on_legend_click

Method on_legend_click

bqplot/plotting_widgets.py:195–204  ·  view source on GitHub ↗
(self, line, target)

Source from the content-addressed store, hash-verified

193 self.loops.fill_opacities = [0.0] * len(self.loops.y)
194
195 def on_legend_click(self, line, target):
196 selected_ix = target["data"]["index"]
197 n = len(line.y)
198 opacities = line.opacities
199 if opacities is None or len(opacities) == 0:
200 opacities = [1.0] * n
201
202 new_opacities = [0.1] * n
203 new_opacities[selected_ix] = 1
204 line.opacities = new_opacities
205
206 def reset(self, line, target):
207 line.opacities = [1.0] * len(line.y)

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected