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

Function create_figure_hist

js/src/test/widget-utils.ts:364–414  ·  view source on GitHub ↗
(manager, sample, bins)

Source from the content-addressed store, hash-verified

362}
363
364export async function create_figure_hist(manager, sample, bins) {
365 const layout = await create_model(
366 manager,
367 '@jupyter-widgets/base',
368 'LayoutModel',
369 'LayoutView',
370 'layout_figure1',
371 { _dom_classes: '', width: '400px', height: '500px' }
372 );
373 const scale_sample = await create_model_bqplot(
374 manager,
375 'LinearScale',
376 'scale_sample',
377 { allow_padding: false }
378 );
379 const scale_count = await create_model_bqplot(
380 manager,
381 'LinearScale',
382 'scale_count',
383 { allow_padding: false }
384 );
385 const scales = { sample: scale_sample.toJSON(), count: scale_count.toJSON() };
386
387 const histModel = await create_model_bqplot(manager, 'Hist', 'hist1', {
388 scales: scales,
389 sample: sample,
390 bins: bins,
391 visible: true,
392 default_size: 64,
393 preserve_domain: {},
394 _view_module_version: '*',
395 _view_module: 'bqplot',
396 });
397 let figureModel;
398 try {
399 figureModel = await create_model_bqplot(manager, 'Figure', 'figure1', {
400 scale_x: scales.sample,
401 scale_y: scales.count,
402 layout: layout.toJSON(),
403 _dom_classes: [],
404 figure_padding_y: 0,
405 fig_margin: { bottom: 0, left: 0, right: 0, top: 0 },
406 marks: [histModel.toJSON()],
407 });
408 } catch (e) {
409 console.error('error', e);
410 }
411 const figure = await create_view(manager, figureModel);
412 await manager.display_view(undefined, figure);
413 return { figure: figure, hist: await figure.mark_views.views[0] };
414}
415
416export async function create_figure_gridheatmap(manager, color) {
417 const layout = await create_model(

Callers 1

hist.tsFile · 0.90

Calls 4

create_modelFunction · 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…