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

Method update_unique_ids

js/src/ScatterModel.ts:64–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62 }
63
64 update_unique_ids() {
65 let names = this.get('names');
66 const show_labels = names != null && names.length !== 0;
67 names = show_labels
68 ? names
69 : this.mark_data.map((data, index) => {
70 return 'Dot' + index;
71 });
72 let unique_ids = [];
73 if (this.get('names_unique')) {
74 unique_ids = names.slice(0);
75 } else {
76 unique_ids = _.range(this.mark_data.length);
77 }
78
79 this.mark_data.forEach((data, index) => {
80 data.name = names[index];
81 data.unique_id = unique_ids[index];
82 });
83 }
84
85 static serializers = {
86 ...ScatterBaseModel.serializers,

Callers 1

initializeMethod · 0.95

Calls 1

rangeMethod · 0.80

Tested by

no test coverage detected