MCPcopy Create free account
hub / github.com/bqplot/bqplot / get_labels

Method get_labels

js/src/LinesModel.ts:139–156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137 }
138
139 get_labels() {
140 // Function to set the labels appropriately.
141 // Setting the labels to the value sent and filling in the
142 // remaining values.
143 let curve_labels = this.get('labels');
144 const data_length =
145 this.x_data.length == 1
146 ? this.y_data.length
147 : Math.min(this.x_data.length, this.y_data.length);
148 if (curve_labels.length > data_length) {
149 curve_labels = curve_labels.slice(0, data_length);
150 } else if (curve_labels.length < data_length) {
151 _.range(curve_labels.length, data_length).forEach((index) => {
152 curve_labels[index] = 'C' + (index + 1);
153 });
154 }
155 return curve_labels;
156 }
157
158 update_domains() {
159 if (!this.mark_data) {

Callers 4

update_dataMethod · 0.95
update_labelsMethod · 0.95
draw_legendMethod · 0.80
update_dataMethod · 0.80

Calls 1

rangeMethod · 0.80

Tested by

no test coverage detected