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

Method manageBarLabels

js/src/Bars.ts:518–537  ·  view source on GitHub ↗

* Main entry point function for adding bar labels * @param barGroups - D3 selection for all bar groups * @param bandWidth - Bandwidth of the x or y axis * @param dom - X or y axis (depending on oridnetation) * @param rang - X or y axis (depending on orientation)

(
    barGroups: any,
    bandWidth: number,
    dom: string,
    rang: string
  )

Source from the content-addressed store, hash-verified

516 * @param rang - X or y axis (depending on orientation)
517 */
518 private manageBarLabels(
519 barGroups: any,
520 bandWidth: number,
521 dom: string,
522 rang: string
523 ): void {
524 if (!this.model.get('label_display')) {
525 return;
526 }
527
528 // Ladding the labels
529 if (this.model.get('type') === 'stacked') {
530 this.stackedBarLabels(barGroups, bandWidth, dom, rang);
531 } else {
532 this.groupedBarLabels(barGroups, bandWidth);
533 }
534
535 // Styling the labels
536 this.updateBarLabelsStyle();
537 }
538
539 /**
540 * All bars are stacked by default. The only other value this parameter can take is 'grouped'

Callers 1

drawBarsMethod · 0.95

Calls 3

stackedBarLabelsMethod · 0.95
groupedBarLabelsMethod · 0.95
updateBarLabelsStyleMethod · 0.95

Tested by

no test coverage detected