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

Method set_interaction

js/src/Figure.ts:1164–1189  ·  view source on GitHub ↗
(model: WidgetModel | null)

Source from the content-addressed store, hash-verified

1162 }
1163
1164 async set_interaction(model: WidgetModel | null): Promise<WidgetView> {
1165 if (model) {
1166 // Sets the child interaction
1167 await model.state_change;
1168
1169 // Sets the child interaction
1170 // @ts-ignore: We should use the type argument: this.create_child_view<Interaction>
1171 const view: Interaction = await this.create_child_view(model);
1172
1173 if (this.interaction_view) {
1174 this.interaction_view.remove();
1175 }
1176 this.interaction_view = view;
1177 this.interaction.node().appendChild(view.el);
1178 this.displayed.then(() => {
1179 view.trigger('displayed');
1180 });
1181 return view;
1182 } else {
1183 if (this.interaction_view) {
1184 this.interaction_view.remove();
1185 this.interaction_view = null;
1186 }
1187 return Promise.resolve(null);
1188 }
1189 }
1190
1191 update_title(model, title) {
1192 this.title.text(this.model.get('title'));

Callers 2

renderImplMethod · 0.95
interacts.tsFile · 0.80

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected