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

Method get_text_styling

js/src/Axis.ts:528–540  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

526 }
527
528 get_text_styling() {
529 // This function returns the text styling based on the attributes
530 // of the axis. As of now, only the text-anchor attribute is set.
531 // More can be added :)
532 const label_location = this.model.get('label_location');
533 if (label_location === 'start') {
534 return { 'text-anchor': 'start' };
535 } else if (label_location === 'end') {
536 return { 'text-anchor': 'end' };
537 } else {
538 return { 'text-anchor': 'middle' };
539 }
540 }
541
542 update_label() {
543 this.g_axisline.select('text.axislabel').text(this.model.get('label'));

Callers 3

append_axisMethod · 0.95
update_label_locationMethod · 0.95
rescale_axisMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected