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

Method update_paddings

js/src/Figure.ts:900–926  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

898 }
899
900 update_paddings() {
901 // Iterate over the paddings of the marks for each scale and store
902 // the maximum padding for each scale on the X and Y in
903 // xPaddingArr and yPaddingArr
904
905 this.xPaddingArr = {};
906 this.yPaddingArr = {};
907
908 _.forEach(this.x_pad_dict, (dict: any, scale_id) => {
909 let max = 0;
910 _.forEach(dict, (value: number, key) => {
911 max = Math.max(max, value);
912 });
913 this.xPaddingArr[scale_id] = max;
914 });
915
916 _.forEach(this.y_pad_dict, (dict: any, scale_id) => {
917 let max = 0;
918 _.forEach(dict, (value: number, key) => {
919 max = Math.max(max, value);
920 });
921 this.yPaddingArr[scale_id] = max;
922 });
923 // This is for the figure to relayout everything to account for the
924 // updated margins.
925 this.trigger('margin_updated');
926 }
927
928 relayout() {
929 if (this.rendered && !this.relayoutRequested) {

Callers 3

mark_scales_updatedMethod · 0.95
mark_padding_updatedMethod · 0.95
update_marksMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected