6d60be3b73b0ef4e1353747eb8be4a9d904d34ba,bokeh/charts/builder/bar_builder.py,BarBuilder,_yield_renderers,#BarBuilder#,206
Before Change
Takes reference points from data loaded at the ColumnDataSource.
quartets = list(chunk(self._attr, 4))
colors = cycle_colors(quartets, self.palette)
// quartet elements are: [data, mid, stacked, cat]
for i, quartet in enumerate(quartets):
if self.stacked:
glyph = Rect(
x="cat", y=quartet[2],
width="width", height=quartet[0],
fill_color=colors[i], fill_alpha=0.7,
line_color="white"
)
else: // Grouped
glyph = Rect(
x=quartet[3], y=quartet[1],
width="width_cat", height=quartet[0],
fill_color=colors[i], fill_alpha=0.7,
line_color="white"
)
renderer = GlyphRenderer(data_source=self._source, glyph=glyph)
self.legends.append((self._groups[i], [renderer]))
yield renderer
After Change
color = self.attributes["color"]
stack = self.attributes["stack"]
for group in self._data.groupby(color, stack):
renderer = BarGlyph(label=group.label,
values=group.data[self.values.selection].values,
agg=self.agg).renderers
// a higher level function of bar chart is to keep track of max height of all bars
self.max_height = max(max(renderer.data_source._data["height"]), self.max_height)
self._legends.append((str(group.label), [renderer]))
yield renderer
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 11
Instances
Project Name: bokeh/bokeh
Commit Name: 6d60be3b73b0ef4e1353747eb8be4a9d904d34ba
Time: 2015-08-23
Author: nroth@dealnews.com
File Name: bokeh/charts/builder/bar_builder.py
Class Name: BarBuilder
Method Name: _yield_renderers
Project Name: pantsbuild/pants
Commit Name: 91cdde2ef79e87a9cb0d80cb55769bc23dc271cc
Time: 2014-08-19
Author: john.sirois@gmail.com
File Name: src/python/pants/backend/jvm/tasks/dependencies.py
Class Name: Dependencies
Method Name: console_output
Project Name: graphbrain/graphbrain
Commit Name: e4378ddc530abc356c8ca4e3e6a317562b104c96
Time: 2011-10-26
Author: telmo@telmomenezes.net
File Name: gb/node.py
Class Name: Node
Method Name: neighbours_json