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

Function initialize_additional_scales

js/src/ScatterBase.ts:143–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141 }
142
143 initialize_additional_scales() {
144 // function to create the additional scales and create the
145 // listeners for the additional scales
146 const color_scale = this.scales.color,
147 size_scale = this.scales.size,
148 opacity_scale = this.scales.opacity,
149 skew_scale = this.scales.skew,
150 rotation_scale = this.scales.rotation;
151 // the following handlers are for changes in data that does not
152 // impact the position of the elements
153 if (color_scale) {
154 this.listenTo(color_scale, 'domain_changed', () => {
155 const animate = true;
156 if (!this.model.dirty) {
157 this.color_scale_updated(animate);
158 }
159 });
160 color_scale.on(
161 'color_scale_range_changed',
162 this.color_scale_updated,
163 this
164 );
165 }
166 if (size_scale) {
167 this.listenTo(size_scale, 'domain_changed', () => {
168 const animate = true;
169 this.update_default_size(animate);
170 });
171 }
172 if (opacity_scale) {
173 this.listenTo(opacity_scale, 'domain_changed', () => {
174 const animate = true;
175 this.update_opacities(animate);
176 });
177 }
178 if (skew_scale) {
179 this.listenTo(skew_scale, 'domain_changed', () => {
180 const animate = true;
181 this.update_default_skew(animate);
182 });
183 }
184 if (rotation_scale) {
185 this.listenTo(rotation_scale, 'domain_changed', () => {
186 const animate = true;
187 this.update_position(animate);
188 });
189 }
190 }
191
192 create_listeners() {
193 super.create_listeners();

Callers

nothing calls this directly

Calls 5

update_positionMethod · 0.80
color_scale_updatedMethod · 0.45
update_default_sizeMethod · 0.45
update_opacitiesMethod · 0.45
update_default_skewMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…