kaxe 1.5.0.dev1__tar.gz → 1.5.0.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kaxe-1.5.0.dev1/src/kaxe.egg-info → kaxe-1.5.0.dev2}/PKG-INFO +1 -1
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/pyproject.toml +1 -1
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/axis.py +20 -8
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/window.py +47 -11
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/grid.py +53 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2/src/kaxe.egg-info}/PKG-INFO +1 -1
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/LICENSE +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/MANIFEST.in +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/README.md +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/setup.cfg +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/__init__.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/chart/__init__.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/chart/bar.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/chart/box.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/chart/pie.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/chart/qqplot.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/__init__.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/bounds.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/color.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/d3/backend.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/d3/camera.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/d3/helper.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/d3/hud.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/d3/objects/__init__.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/d3/objects/color.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/d3/objects/line.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/d3/objects/point.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/d3/objects/pointer.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/d3/objects/triangle.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/d3/openglrender.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/d3/translator.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/draw.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/fileloader.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/helper.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/legend.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/line.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/marker.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/profiler.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/round.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/shapes.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/styles.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/svg.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/svg_pdf.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/symbol.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/core/text.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/data/__init__.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/data/excel.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/__init__.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/_lazy.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d2/__init__.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d2/arrow.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d2/bubble.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d2/contour.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d2/equation.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d2/fill.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d2/function.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d2/inequality.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d2/map.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d2/parameter.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d2/pillar.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d2/point.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d3/__init__.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d3/base.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d3/function.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d3/mesh.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d3/point.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/d3/potato.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/function.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/legend.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/mapdata.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/point.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/objects/text.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/__init__.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/_lazy.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/box.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/constants.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/d3/__init__.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/d3/axes.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/d3/geometry.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/d3/plot3d.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/d3/variants.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/double.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/empty.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/log.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/polar.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/standard.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/themes.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/zoom.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/plot/zoom_connector.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/__init__.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/__init__.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.bright-oblique.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.bright-roman.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.bright-semibold.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.bright-semiboldoblique.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.classical-serif-italic.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.concrete-bold.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.concrete-bolditalic.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.concrete-italic.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.concrete-roman.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.sans-serif-bold.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.sans-serif-boldoblique.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.sans-serif-demi-condensed-demicondensed.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.sans-serif-medium.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.sans-serif-oblique.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.serif-bold.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.serif-bolditalic.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.serif-extra-boldslanted.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.serif-extra-romanslanted.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.serif-italic.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.serif-roman.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.serif-upright-italic-uprightitalic.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.typewriter-text-bold.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.typewriter-text-bolditalic.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.typewriter-text-italic.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.typewriter-text-light.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.typewriter-text-lightoblique.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.typewriter-text-regular.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.typewriter-text-variable-width-italic.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.typewriter-text-variable-width-medium.ttf +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/readme.txt +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/logo-small.png +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/symbolcross.png +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/symboldonut.png +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/symbollollipop.png +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/symboltriangle.png +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe.egg-info/SOURCES.txt +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe.egg-info/dependency_links.txt +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe.egg-info/requires.txt +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe.egg-info/top_level.txt +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/tests/test.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/tests/test2.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/tests/test3.py +0 -0
- {kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/tests/test_5.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kaxe
|
|
3
|
-
Version: 1.5.0.
|
|
3
|
+
Version: 1.5.0.dev2
|
|
4
4
|
Summary: A small graphing tool for functions, points, equations and more
|
|
5
5
|
Author-email: Valter Yde Daugberg <valteryde@hotmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/valteryde/kaxe
|
|
@@ -115,13 +115,16 @@ class Axis(AttrObject):
|
|
|
115
115
|
length = self.endNumber - self.startNumber
|
|
116
116
|
|
|
117
117
|
numberOnAxisGoal = self.getAttr(self.numberOnAxisGoalReference)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
explicit_goal = bool(numberOnAxisGoal)
|
|
119
|
+
if not numberOnAxisGoal:
|
|
120
|
+
numberOnAxisGoal = max(
|
|
121
|
+
4, pixelLength // (2 * self.getAttr('fontSize'))
|
|
122
|
+
)
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
if explicit_goal and numberOnAxisGoal < 3:
|
|
125
|
+
acceptence = [numberOnAxisGoal - 1, numberOnAxisGoal + 1]
|
|
126
|
+
else:
|
|
127
|
+
acceptence = [max(3, numberOnAxisGoal - 1), numberOnAxisGoal + 1]
|
|
125
128
|
|
|
126
129
|
MARKERSTEP = [2, 5, 10]
|
|
127
130
|
|
|
@@ -158,8 +161,17 @@ class Axis(AttrObject):
|
|
|
158
161
|
continue
|
|
159
162
|
|
|
160
163
|
break
|
|
161
|
-
|
|
162
|
-
|
|
164
|
+
|
|
165
|
+
if not explicit_goal or numberOnAxisGoal >= 3:
|
|
166
|
+
min_intervals = 3
|
|
167
|
+
refine_c = c
|
|
168
|
+
while round(length / step) < min_intervals and refine_c > 0:
|
|
169
|
+
refine_c -= 1
|
|
170
|
+
step = MARKERSTEP[refine_c % len(MARKERSTEP)] * 10 ** (
|
|
171
|
+
refine_c // len(MARKERSTEP)
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
lengthOverStep = round(length / step)
|
|
163
175
|
|
|
164
176
|
# is null in frame?
|
|
165
177
|
nullX, nullY = self.get(0)
|
|
@@ -40,6 +40,37 @@ except:
|
|
|
40
40
|
|
|
41
41
|
settings = {"removeInfo":False}
|
|
42
42
|
|
|
43
|
+
def compute_adjust_styles(
|
|
44
|
+
procentWidth,
|
|
45
|
+
documentFontSize=0.25,
|
|
46
|
+
documentMarginProcent=1.5,
|
|
47
|
+
documentWidth=11.8,
|
|
48
|
+
imageSlimRatio=1,
|
|
49
|
+
):
|
|
50
|
+
"""Compute width, height, and fontSize for LaTeX page-fraction sizing."""
|
|
51
|
+
width = 4000 * procentWidth
|
|
52
|
+
height = width / (1 + procentWidth) * imageSlimRatio
|
|
53
|
+
fontSize = documentFontSize / (
|
|
54
|
+
procentWidth * (documentWidth - 2 * documentMarginProcent)
|
|
55
|
+
) * width
|
|
56
|
+
return {
|
|
57
|
+
"width": int(width),
|
|
58
|
+
"height": int(height),
|
|
59
|
+
"fontSize": int(fontSize),
|
|
60
|
+
"outerPadding": (10, 10, 10, 10),
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def compute_axis_numbers(width_px, height_px, font_size, min_ticks=4):
|
|
65
|
+
"""Target tick counts from pixel extent and font size (~2*fontSize per tick)."""
|
|
66
|
+
divisor = 2 * font_size
|
|
67
|
+
if divisor <= 0:
|
|
68
|
+
divisor = 1
|
|
69
|
+
x_numbers = max(min_ticks, int(width_px // divisor))
|
|
70
|
+
y_numbers = max(min_ticks, int(height_px // divisor))
|
|
71
|
+
return x_numbers, y_numbers
|
|
72
|
+
|
|
73
|
+
|
|
43
74
|
def setSetting(**kwargs):
|
|
44
75
|
"""Set global Kaxe runtime settings.
|
|
45
76
|
|
|
@@ -169,7 +200,7 @@ class Window(AttrObject):
|
|
|
169
200
|
"""
|
|
170
201
|
Adjust the following styles based on document size and document font size. i. e. match document font size with plot font size
|
|
171
202
|
|
|
172
|
-
Directly changed styles; fontSize, width, height, outerPadding
|
|
203
|
+
Directly changed styles; fontSize, width, height, outerPadding, xNumbers, yNumbers
|
|
173
204
|
|
|
174
205
|
A lot of styles indirecitly relies on fontSize, width and height.
|
|
175
206
|
|
|
@@ -183,16 +214,21 @@ class Window(AttrObject):
|
|
|
183
214
|
|
|
184
215
|
"""
|
|
185
216
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
217
|
+
styles = compute_adjust_styles(
|
|
218
|
+
procentWidth,
|
|
219
|
+
documentFontSize=documentFontSize,
|
|
220
|
+
documentMarginProcent=documentMarginProcent,
|
|
221
|
+
documentWidth=documentWidth,
|
|
222
|
+
imageSlimRatio=imageSlimRatio,
|
|
223
|
+
)
|
|
224
|
+
x_numbers, y_numbers = compute_axis_numbers(
|
|
225
|
+
styles["width"], styles["height"], styles["fontSize"]
|
|
226
|
+
)
|
|
227
|
+
self.style(
|
|
228
|
+
**styles,
|
|
229
|
+
xNumbers=x_numbers,
|
|
230
|
+
yNumbers=y_numbers,
|
|
231
|
+
)
|
|
196
232
|
|
|
197
233
|
|
|
198
234
|
# paddings
|
|
@@ -23,6 +23,14 @@ def _cell_supports_svg(plot) -> bool:
|
|
|
23
23
|
return getattr(plot, "supports_vector_export", False)
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
def _grid_has_3d_cells(grid) -> bool:
|
|
27
|
+
for row in grid:
|
|
28
|
+
for plot in row:
|
|
29
|
+
if plot == XYZPLOT or getattr(plot, "identity", None) == XYZPLOT:
|
|
30
|
+
return True
|
|
31
|
+
return False
|
|
32
|
+
|
|
33
|
+
|
|
26
34
|
class Grid(AttrObject):
|
|
27
35
|
"""
|
|
28
36
|
Assemble multiple plots in one image.
|
|
@@ -101,6 +109,50 @@ class Grid(AttrObject):
|
|
|
101
109
|
self.style(**theme)
|
|
102
110
|
|
|
103
111
|
|
|
112
|
+
def adjust(self, procentWidth, documentFontSize=0.25, documentMarginProcent=1.5, documentWidth=11.8, imageSlimRatio=1):
|
|
113
|
+
"""
|
|
114
|
+
Adjust grid size and typography for LaTeX page fractions (same API as :meth:`kaxe.Plot.adjust`).
|
|
115
|
+
|
|
116
|
+
Sets width, height, fontSize, outerPadding, and per-cell xNumbers / yNumbers from cell size.
|
|
117
|
+
zNumbers is set when the grid contains 3D plots.
|
|
118
|
+
|
|
119
|
+
See :meth:`kaxe.core.window.Window.adjust` for parameter details.
|
|
120
|
+
"""
|
|
121
|
+
styles = compute_adjust_styles(
|
|
122
|
+
procentWidth,
|
|
123
|
+
documentFontSize=documentFontSize,
|
|
124
|
+
documentMarginProcent=documentMarginProcent,
|
|
125
|
+
documentWidth=documentWidth,
|
|
126
|
+
imageSlimRatio=imageSlimRatio,
|
|
127
|
+
)
|
|
128
|
+
cols = max((len(row) for row in self.grid), default=1) or 1
|
|
129
|
+
rows = len(self.grid) or 1
|
|
130
|
+
cell_w = styles["width"] // cols
|
|
131
|
+
cell_h = styles["height"] // rows
|
|
132
|
+
x_numbers, y_numbers = compute_axis_numbers(
|
|
133
|
+
cell_w, cell_h, styles["fontSize"]
|
|
134
|
+
)
|
|
135
|
+
axis_kwargs = {
|
|
136
|
+
"xNumbers": x_numbers,
|
|
137
|
+
"yNumbers": y_numbers,
|
|
138
|
+
}
|
|
139
|
+
if _grid_has_3d_cells(self.grid):
|
|
140
|
+
z_extent = min(cell_w, cell_h)
|
|
141
|
+
axis_kwargs["zNumbers"] = compute_axis_numbers(
|
|
142
|
+
z_extent, z_extent, styles["fontSize"]
|
|
143
|
+
)[0]
|
|
144
|
+
self.style(**styles, **axis_kwargs)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def _axis_style_kwargs(self):
|
|
148
|
+
kwargs = {}
|
|
149
|
+
for attr in ("xNumbers", "yNumbers", "zNumbers"):
|
|
150
|
+
value = self.getAttr(attr)
|
|
151
|
+
if value is not None:
|
|
152
|
+
kwargs[attr] = value
|
|
153
|
+
return kwargs
|
|
154
|
+
|
|
155
|
+
|
|
104
156
|
def _reset_cell_bake_state(self, plot):
|
|
105
157
|
if plot == XYZPLOT or isinstance(plot, str):
|
|
106
158
|
return
|
|
@@ -120,6 +172,7 @@ class Grid(AttrObject):
|
|
|
120
172
|
outerPadding=self.outerPadding,
|
|
121
173
|
fontSize=self.getAttr('fontSize'),
|
|
122
174
|
color=self.getAttr('color'),
|
|
175
|
+
**self._axis_style_kwargs(),
|
|
123
176
|
)
|
|
124
177
|
|
|
125
178
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kaxe
|
|
3
|
-
Version: 1.5.0.
|
|
3
|
+
Version: 1.5.0.dev2
|
|
4
4
|
Summary: A small graphing tool for functions, points, equations and more
|
|
5
5
|
Author-email: Valter Yde Daugberg <valteryde@hotmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/valteryde/kaxe
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.bright-oblique.ttf
RENAMED
|
File without changes
|
{kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.bright-roman.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.concrete-bold.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.concrete-roman.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.serif-bold.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.serif-italic.ttf
RENAMED
|
File without changes
|
{kaxe-1.5.0.dev1 → kaxe-1.5.0.dev2}/src/kaxe/resources/computer-modern-family/cmu.serif-roman.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|