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

Function create_figure_pie

js/src/test/widget-utils.ts:239–292  ·  view source on GitHub ↗
(manager, sizes, labels)

Source from the content-addressed store, hash-verified

237}
238
239export async function create_figure_pie(manager, sizes, labels) {
240 const layout = await create_model(
241 manager,
242 '@jupyter-widgets/base',
243 'LayoutModel',
244 'LayoutView',
245 'layout_figure1',
246 { _dom_classes: '', width: '400px', height: '500px' }
247 );
248
249 const scale_x = await create_model_bqscales(
250 manager,
251 'LinearScale',
252 'scale_x',
253 {
254 allow_padding: false,
255 }
256 );
257 const scale_y = await create_model_bqscales(
258 manager,
259 'LinearScale',
260 'scale_y',
261 {
262 allow_padding: false,
263 }
264 );
265
266 const pieModel = await create_model_bqplot(manager, 'Pie', 'pie1', {
267 sizes: sizes,
268 labels: labels,
269 visible: true,
270 default_size: 64,
271 preserve_domain: {},
272 _view_module_version: '*',
273 _view_module: 'bqplot',
274 });
275 let figureModel;
276 try {
277 figureModel = await create_model_bqplot(manager, 'Figure', 'figure1', {
278 scale_x: scale_x.toJSON(),
279 scale_y: scale_y.toJSON(),
280 layout: layout.toJSON(),
281 _dom_classes: [],
282 figure_padding_y: 0,
283 fig_margin: { bottom: 0, left: 0, right: 0, top: 0 },
284 marks: [pieModel.toJSON()],
285 });
286 } catch (e) {
287 console.error('error', e);
288 }
289 const figure = await create_view(manager, figureModel);
290 await manager.display_view(undefined, figure);
291 return { figure: figure, pie: await figure.mark_views.views[0] };
292}
293
294export async function create_figure_bars(manager, x, y) {
295 const layout = await create_model(

Callers 1

pie.tsFile · 0.90

Calls 5

create_modelFunction · 0.85
create_model_bqscalesFunction · 0.85
create_model_bqplotFunction · 0.85
create_viewFunction · 0.85
display_viewMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…