Skip to content

Commit

Permalink
Customizations for Kikora
Browse files Browse the repository at this point in the history
Acked-by: Tore Sund Norderud <[email protected]>
  • Loading branch information
torenord committed Jan 25, 2021
1 parent c035461 commit 9f5366b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions matplotlib/pyplot/__init__.js
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ jsplotlib.get_color = function(cs) {
jsplotlib.make_chart = function(width, height, insert_container, insert_mode,
attributes) {
chart_counter++;
var DEFAULT_PADDING = 10;
var DEFAULT_PADDING = 0;
insert_container = insert_container || "body";
width = width - 2 * DEFAULT_PADDING || 500;
height = height - 2 * DEFAULT_PADDING || 200;
Expand All @@ -1336,6 +1336,7 @@ jsplotlib.make_chart = function(width, height, insert_container, insert_mode,
chart.attr('class', 'chart');
chart.attr('width', width);
chart.attr('height', height);
chart.attr('viewBox', '-20 -20 420 420');
chart.attr('chart_count', chart_counter);

// set additional given attributes
Expand All @@ -1345,7 +1346,8 @@ jsplotlib.make_chart = function(width, height, insert_container, insert_mode,
}
}

$('.chart#' + attributes.id).css("padding", DEFAULT_PADDING + 'px').css("overflow", "visible");
$('.chart#' + attributes.id).css("padding", DEFAULT_PADDING + 'px');

return chart;
};

Expand Down Expand Up @@ -1957,6 +1959,9 @@ var $builtinmodule = function(name) {
// result
var result = [];

$('svg.chart').attr('width', '100%');
$('svg.chart').attr('height', '100%');

return new Sk.builtins.tuple(result);
};
plot_f.co_kwargs = true;
Expand Down

0 comments on commit 9f5366b

Please sign in to comment.