Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphics overhault rebase1 #1373

Draft
wants to merge 54 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
90aac8c
basic LayoutEngine working
poke1024 Aug 30, 2016
a253dd7
adds FontSize
poke1024 Aug 30, 2016
a156481
added --svg-math parameter to enable layout engine; not used by default
poke1024 Aug 31, 2016
50dbf64
LayoutEngine constructor now raises Exceptions
poke1024 Aug 31, 2016
bd08c19
fixes error reporting
poke1024 Aug 31, 2016
aaf113f
error handling cosmetics
poke1024 Aug 31, 2016
6a3ec6b
got rid of zerorpc since it is such a dependency hell
poke1024 Sep 1, 2016
f95027f
allow environment variables in node paths
poke1024 Sep 1, 2016
f0900ee
fixes NODE_MODULES
poke1024 Sep 1, 2016
24edc95
work in progress: mix mglyph and svg-only approach
poke1024 Sep 3, 2016
c30595d
several small improvement for more stability
poke1024 Sep 4, 2016
be7106e
major cleanup
poke1024 Sep 4, 2016
f5c5e6d
fixes node.js output; better warnings
poke1024 Sep 4, 2016
ef52066
basic version of Rasterize[], fixes for the classic Mathics frontend
poke1024 Sep 5, 2016
dcda65a
better error handling
poke1024 Sep 5, 2016
4d725a3
fixes Python 2 syntax error
poke1024 Sep 10, 2016
0116477
added nowebeng message
poke1024 Sep 14, 2016
c7c54c7
got rid of NODE and NODE_MODULES in settings.py; the cleanest way to …
poke1024 Sep 14, 2016
f9144b2
Rasterize[] changed to use PIL
poke1024 Sep 15, 2016
ea0b17a
fixes Rasterize[]: avoid embedding svgs in svgs
poke1024 Sep 15, 2016
6e694d8
fixes a bug in TerminalOutput
poke1024 Sep 15, 2016
e6bbb13
better node config/startup
poke1024 Oct 18, 2016
e51b5a6
merge with transforms
poke1024 Oct 21, 2016
44adcfd
merge transforms
poke1024 Oct 21, 2016
d9407ed
merge transforms
poke1024 Oct 21, 2016
72abc7a
merge transforms
poke1024 Oct 21, 2016
cb915dc
merge transforms
poke1024 Oct 21, 2016
6729d0c
merge transforms
poke1024 Oct 21, 2016
941a839
various fixes regarding text and points
poke1024 Oct 21, 2016
6c70521
fixes test case
poke1024 Oct 21, 2016
d7aeb05
preparations for Mathics computed transforms
poke1024 Nov 5, 2016
7bff167
fixes Plot[1+x*0.000001, {x, 0, 1}]
poke1024 Nov 5, 2016
86d4f1c
various cleanups and fixes
poke1024 Nov 5, 2016
fb2d1db
fixes test case
poke1024 Nov 5, 2016
e85bef5
fix node.js server startup
poke1024 Aug 30, 2020
0854801
merge 1.1
mmatera May 12, 2021
08c4f8f
merge 1.1.1
mmatera May 12, 2021
ace3235
merge 2.0
mmatera May 12, 2021
22471da
merge 2.1
mmatera May 12, 2021
7b077e3
merge master
mmatera May 13, 2021
386767f
fix
mmatera May 13, 2021
1d1979f
fix3
mmatera May 13, 2021
346dadf
fix6
mmatera May 14, 2021
b5ecad4
fix test
mmatera May 14, 2021
ee18ee0
fix 8
mmatera May 14, 2021
82e3ad8
fixaa
mmatera May 14, 2021
e26e1d2
fixxxxx
mmatera May 15, 2021
6448755
fixxx
mmatera May 15, 2021
abd24d3
merge
mmatera May 15, 2021
9bc1128
fix plot
mmatera May 15, 2021
4327ba8
tmp
mmatera May 15, 2021
23309b4
implementig boxerror
mmatera May 15, 2021
3ea6856
clean
mmatera May 15, 2021
0a283aa
Merge remote-tracking branch 'upstream/master' into graphics-overhaul…
mmatera May 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixxxxx
  • Loading branch information
mmatera committed May 15, 2021
commit e26e1d226d4657b3019ac86ea645189f6d38dc42
3 changes: 1 addition & 2 deletions mathics/builtin/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,6 @@ def to_rgba(self):
return self.to_color_space("RGB")

def to_color_space(self, color_space):
print("colorspace=", self.color_space, "components:", self.components)
components = convert_color(self.components, self.color_space, color_space)
if components is None:
raise ValueError(
Expand Down Expand Up @@ -3817,10 +3816,10 @@ def boxes_to_mathml(self, leaves=None, **options):
leaves = self._leaves
try:
elements, calc_dimensions = self._prepare_elements(leaves, options, neg_y=True)
print("calc_dimensions:", calc_dimensions)
except:
if self.evaluation:
self.evaluation.message("General", "notboxes", Expression("GraphicsBox", self._leaves))
return

xmin, xmax, ymin, ymax, w, h, width, height = calc_dimensions()
data = (elements, xmin, xmax, ymin, ymax, w, h, width, height)
Expand Down
10 changes: 8 additions & 2 deletions mathics/builtin/inout.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
PrecisionReal,
SymbolList,
SymbolMakeBoxes,
SymbolRule
SymbolNull,
SymbolRule,
)
from mathics.core.numbers import (
dps,
Expand Down Expand Up @@ -2101,7 +2102,10 @@ def apply_mathml(self, expr, evaluation) -> Expression:
"notboxes",
Expression("FullForm", boxes).evaluate(evaluation),
)
xml = ""
xml = None
if xml is None:
return Expression("RowBox", Expression(SymbolList, String("")))

is_a_picture = xml[:6] == "<mtext"

# mathml = '<math><mstyle displaystyle="true">%s</mstyle></math>' % xml
Expand Down Expand Up @@ -2206,6 +2210,8 @@ def apply_tex(self, expr, evaluation) -> Expression:
boxes = MakeBoxes(expr).evaluate(evaluation)
try:
tex = boxes.boxes_to_tex(evaluation=evaluation)
if tex is None:
return Expression("RowBox", Expression(SymbolList, String("")))

# Replace multiple newlines by a single one e.g. between asy-blocks
tex = MULTI_NEWLINE_RE.sub("\n", tex)
Expand Down