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

Method update_domains

js/src/GridHeatMapModel.ts:98–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96 }
97
98 update_domains() {
99 if (!this.mark_data) {
100 return;
101 }
102 const scales = this.getScales();
103 const y_scale = scales.row,
104 x_scale = scales.column;
105 const color_scale = scales.color;
106
107 if (!this.get('preserve_domain').row) {
108 y_scale.computeAndSetDomain(this.rows, this.model_id + '_row');
109 } else {
110 y_scale.delDomain([], this.model_id + '_row');
111 }
112
113 if (!this.get('preserve_domain').column) {
114 x_scale.computeAndSetDomain(this.columns, this.model_id + '_column');
115 } else {
116 x_scale.delDomain([], this.model_id + '_column');
117 }
118 if (color_scale !== null && color_scale !== undefined) {
119 if (!this.get('preserve_domain').color) {
120 color_scale.computeAndSetDomain(
121 this.mark_data.map((elem) => elem.color),
122 this.model_id + '_color'
123 );
124 } else {
125 color_scale.delDomain([], this.model_id + '_color');
126 }
127 }
128 }
129
130 get_data_dict(data, index) {
131 return data;

Callers 2

initializeMethod · 0.95
update_dataMethod · 0.95

Calls 1

getScalesMethod · 0.45

Tested by

no test coverage detected