Skip to content

Commit

Permalink
adding background and tooltips to Graphics3D (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatera authored Jan 19, 2024
1 parent 0016f91 commit 587ce3f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mathics_django/web/media/js/mathics.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,12 @@ function createLine(value) {
return translateDOMElement(container.firstChild);
} else if (container?.firstElementChild?.tagName === 'GRAPHICS3D') {
const div = document.createElement('div');

drawGraphics3d(div, JSON.parse(container.firstElementChild.attributes.data.value));
var json_data_value = JSON.parse(container.firstElementChild.attributes.data.value);
div.style.backgroundColor = json_data_value["background_color"];
if ("tooltip_text" in json_data_value){
div.title = json_data_value["tooltip_text"];
}
drawGraphics3d(div, json_data_value);

div.style.overflow = 'hidden';
div.style.position = 'relative';
Expand Down

0 comments on commit 587ce3f

Please sign in to comment.