QuickGraphLib 0.1.0a9__cp39-abi3-win_amd64.whl
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.
- QuickGraphLib/AntialiasingContainer.qml +28 -0
- QuickGraphLib/Axis.qml +227 -0
- QuickGraphLib/CMakeLists.txt +88 -0
- QuickGraphLib/ColorMaps.cpp +632 -0
- QuickGraphLib/ColorMaps.hpp +22 -0
- QuickGraphLib/DataTypes.cpp +68 -0
- QuickGraphLib/DataTypes.hpp +33 -0
- QuickGraphLib/GraphArea.qml +84 -0
- QuickGraphLib/GraphItems/AxHLine.qml +46 -0
- QuickGraphLib/GraphItems/AxHSpan.qml +60 -0
- QuickGraphLib/GraphItems/AxVLine.qml +46 -0
- QuickGraphLib/GraphItems/AxVSpan.qml +60 -0
- QuickGraphLib/GraphItems/BasicLegend.qml +37 -0
- QuickGraphLib/GraphItems/BasicLegendItem.qml +73 -0
- QuickGraphLib/GraphItems/CMakeLists.txt +55 -0
- QuickGraphLib/GraphItems/ColorMesh.qml +39 -0
- QuickGraphLib/GraphItems/Contour.qml +41 -0
- QuickGraphLib/GraphItems/GraphItemDragHandler.qml +50 -0
- QuickGraphLib/GraphItems/Grid.qml +57 -0
- QuickGraphLib/GraphItems/Histogram.qml +53 -0
- QuickGraphLib/GraphItems/Line.qml +42 -0
- QuickGraphLib/GraphItems/Marker.qml +38 -0
- QuickGraphLib/GraphItems/QuickGraphLibGraphItems.dll +0 -0
- QuickGraphLib/GraphItems/QuickGraphLibGraphItems.qmltypes +137 -0
- QuickGraphLib/GraphItems/helpers/GridHelper.cpp +26 -0
- QuickGraphLib/GraphItems/helpers/GridHelper.hpp +58 -0
- QuickGraphLib/GraphItems/helpers/HistogramHelper.cpp +45 -0
- QuickGraphLib/GraphItems/helpers/HistogramHelper.hpp +59 -0
- QuickGraphLib/GraphItems/qmldir +22 -0
- QuickGraphLib/ImageView.cpp +508 -0
- QuickGraphLib/ImageView.hpp +126 -0
- QuickGraphLib/Plugin.cpp +23 -0
- QuickGraphLib/PreFabs/CMakeLists.txt +34 -0
- QuickGraphLib/PreFabs/ImageAxes.qml +195 -0
- QuickGraphLib/PreFabs/QuickGraphLibPreFabs.dll +0 -0
- QuickGraphLib/PreFabs/QuickGraphLibPreFabs.qmltypes +8 -0
- QuickGraphLib/PreFabs/XYAxes.qml +153 -0
- QuickGraphLib/PreFabs/qmldir +9 -0
- QuickGraphLib/QuickGraphLib.dll +0 -0
- QuickGraphLib/QuickGraphLib.hpp +6 -0
- QuickGraphLib/QuickGraphLib.qmltypes +359 -0
- QuickGraphLib/QuickGraphLibPlugin.dll +0 -0
- QuickGraphLib/ScalingContainer.qml +48 -0
- QuickGraphLib/ShapeRepeater.qml +27 -0
- QuickGraphLib/TickLabel.qml +65 -0
- QuickGraphLib/ZoomPanHandler.qml +96 -0
- QuickGraphLib/_QuickGraphLib.pyd +0 -0
- QuickGraphLib/_QuickGraphLib.pyi +129 -0
- QuickGraphLib/__init__.py +28 -0
- QuickGraphLib/_version.py +16 -0
- QuickGraphLib/bindings/Bindings.hpp +6 -0
- QuickGraphLib/bindings/Bindings.xml +29 -0
- QuickGraphLib/bindings/CMakeLists.txt +190 -0
- QuickGraphLib/bindings/ShibokenHelpers.cpp +97 -0
- QuickGraphLib/bindings/ShibokenHelpers.hpp +13 -0
- QuickGraphLib/bindings/glue/DataTypes.cpp +12 -0
- QuickGraphLib/bindings/pyigen.py +43 -0
- QuickGraphLib/consts.py +6 -0
- QuickGraphLib/contours.py +85 -0
- QuickGraphLib/doc/AxesGridLayout.drawio +49 -0
- QuickGraphLib/doc/AxesGridLayout.svg +3 -0
- QuickGraphLib/doc/export.qdoc +47 -0
- QuickGraphLib/doc/graphitems.qdoc +21 -0
- QuickGraphLib/doc/graphstructure.qdoc +221 -0
- QuickGraphLib/doc/index.qdoc +57 -0
- QuickGraphLib/doc/interaction.qdoc +43 -0
- QuickGraphLib/doc/module-cpp.qdoc +40 -0
- QuickGraphLib/doc/module.qdoc +29 -0
- QuickGraphLib/doc/prefabs.qdoc +21 -0
- QuickGraphLib/doc/python_helpers.qdoc +48 -0
- QuickGraphLib/helpers/AxisHelper.cpp +139 -0
- QuickGraphLib/helpers/AxisHelper.hpp +107 -0
- QuickGraphLib/helpers/Foreign.hpp +30 -0
- QuickGraphLib/helpers/Helpers.cpp +422 -0
- QuickGraphLib/helpers/Helpers.hpp +23 -0
- QuickGraphLib/py.typed +0 -0
- QuickGraphLib/qmldir +15 -0
- quickgraphlib-0.1.0a9.dist-info/METADATA +92 -0
- quickgraphlib-0.1.0a9.dist-info/RECORD +81 -0
- quickgraphlib-0.1.0a9.dist-info/WHEEL +5 -0
- quickgraphlib-0.1.0a9.dist-info/licenses/LICENCE +21 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import QtQuick
|
|
5
|
+
|
|
6
|
+
/*!
|
|
7
|
+
\qmltype AntialiasingContainer
|
|
8
|
+
\inqmlmodule QuickGraphLib
|
|
9
|
+
\inherits QtQuick::Item
|
|
10
|
+
\brief Enables antialiasing for it's contents.
|
|
11
|
+
|
|
12
|
+
This item turns on \l {Multisample Antialiasing}. This helps with rendering in some cases.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
Item {
|
|
16
|
+
id: root
|
|
17
|
+
|
|
18
|
+
/*!
|
|
19
|
+
Whether MSAA antialiasing is enabled. This can help with rendering when the target display has a
|
|
20
|
+
fractional scaling factor. It can also make rendering worse, especially with text.
|
|
21
|
+
*/
|
|
22
|
+
property alias antialiasingEnabled: root.layer.enabled
|
|
23
|
+
|
|
24
|
+
implicitHeight: 100
|
|
25
|
+
implicitWidth: 100
|
|
26
|
+
layer.enabled: false //
|
|
27
|
+
layer.samples: 2
|
|
28
|
+
}
|
QuickGraphLib/Axis.qml
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
pragma ComponentBehavior: Bound
|
|
5
|
+
import QtQuick
|
|
6
|
+
import QtQuick.Shapes as QQS
|
|
7
|
+
import QuickGraphLib as QuickGraphLib
|
|
8
|
+
|
|
9
|
+
/*!
|
|
10
|
+
\qmltype Axis
|
|
11
|
+
\inqmlmodule QuickGraphLib
|
|
12
|
+
\inherits QtQuick::Item
|
|
13
|
+
\brief Displays an Axis.
|
|
14
|
+
|
|
15
|
+
\sa {Basic sin graph (without prefabs)}, {Graph with all four axes}
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
Item {
|
|
19
|
+
id: root
|
|
20
|
+
|
|
21
|
+
enum Direction {
|
|
22
|
+
Left,
|
|
23
|
+
Right,
|
|
24
|
+
Top,
|
|
25
|
+
Bottom
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/*!
|
|
29
|
+
Must be assigned the data transform of the graph area this axis is paired to.
|
|
30
|
+
|
|
31
|
+
\sa GraphArea::dataTransform
|
|
32
|
+
*/
|
|
33
|
+
property alias dataTransform: helper.dataTransform
|
|
34
|
+
/*!
|
|
35
|
+
Number of decimal points the ticks should show.
|
|
36
|
+
|
|
37
|
+
\sa TickLabel::decimalPoints
|
|
38
|
+
*/
|
|
39
|
+
property int decimalPoints: 2
|
|
40
|
+
/*!
|
|
41
|
+
The side of the graph the Axis is on. It can take one of the following values:
|
|
42
|
+
|
|
43
|
+
\value Axis.Direction.Left Axis to the left of the GraphArea
|
|
44
|
+
\value Axis.Direction.Right Axis to the right of the GraphArea
|
|
45
|
+
\value Axis.Direction.Top Axis above of the GraphArea
|
|
46
|
+
\value Axis.Direction.Bottom Axis below of the GraphArea
|
|
47
|
+
*/
|
|
48
|
+
property alias direction: helper.direction
|
|
49
|
+
/*!
|
|
50
|
+
The label text for this axis. Alias of \c labelItem.text.
|
|
51
|
+
*/
|
|
52
|
+
property alias label: labelText.text
|
|
53
|
+
/*!
|
|
54
|
+
The color of the label. Alias of \c labelItem.color.
|
|
55
|
+
*/
|
|
56
|
+
property alias labelColor: labelText.color
|
|
57
|
+
/*!
|
|
58
|
+
The font of the label. Alias of \c labelItem.font.
|
|
59
|
+
*/
|
|
60
|
+
property alias labelFont: labelText.font
|
|
61
|
+
/*!
|
|
62
|
+
The axis label (a \l Text).
|
|
63
|
+
*/
|
|
64
|
+
property alias labelItem: labelText
|
|
65
|
+
/*!
|
|
66
|
+
Whether to show a label for each tick.
|
|
67
|
+
*/
|
|
68
|
+
property bool showTickLabels: true
|
|
69
|
+
/*!
|
|
70
|
+
Spacing between the axis label and the tick labels.
|
|
71
|
+
*/
|
|
72
|
+
property double spacing: 4
|
|
73
|
+
/*!
|
|
74
|
+
Color of the axis spine and ticks.
|
|
75
|
+
*/
|
|
76
|
+
property alias strokeColor: myPath.strokeColor
|
|
77
|
+
/*!
|
|
78
|
+
Width of the axis spine and ticks.
|
|
79
|
+
*/
|
|
80
|
+
property alias strokeWidth: myPath.strokeWidth
|
|
81
|
+
/*!
|
|
82
|
+
The component used for rendering tick labels. If overridden,
|
|
83
|
+
the \c color, \c decimalPoints, \c direction, and \c font properties
|
|
84
|
+
of the component should be set explicitly. To get proper positioning,
|
|
85
|
+
it is recommended that \l TickLabel or a subclass is used.
|
|
86
|
+
*/
|
|
87
|
+
property Component tickDelegate: TickLabel {
|
|
88
|
+
color: root.tickLabelColor
|
|
89
|
+
decimalPoints: root.decimalPoints
|
|
90
|
+
direction: root.direction
|
|
91
|
+
font: root.tickLabelFont
|
|
92
|
+
}
|
|
93
|
+
/*!
|
|
94
|
+
The color of the tick labels.
|
|
95
|
+
*/
|
|
96
|
+
property color tickLabelColor: labelColor
|
|
97
|
+
/*!
|
|
98
|
+
The font of the tick labels.
|
|
99
|
+
*/
|
|
100
|
+
property font tickLabelFont: labelFont
|
|
101
|
+
/*!
|
|
102
|
+
The length of each tick.
|
|
103
|
+
*/
|
|
104
|
+
property alias tickLength: helper.tickLength
|
|
105
|
+
/*!
|
|
106
|
+
The position of each tick. This should be a list of doubles in data coordinates.
|
|
107
|
+
|
|
108
|
+
\sa Helpers::range, Helpers::linspace, Grid::xTicks, Grid::yTicks
|
|
109
|
+
*/
|
|
110
|
+
property alias ticks: helper.ticks
|
|
111
|
+
|
|
112
|
+
implicitHeight: {
|
|
113
|
+
switch (root.direction) {
|
|
114
|
+
case Axis.Direction.Left:
|
|
115
|
+
case Axis.Direction.Right:
|
|
116
|
+
return 100;
|
|
117
|
+
case Axis.Direction.Top:
|
|
118
|
+
case Axis.Direction.Bottom:
|
|
119
|
+
let height = 0;
|
|
120
|
+
if (ticks.length > 0) {
|
|
121
|
+
// Can't use childrenRect due to the binding loop it causes
|
|
122
|
+
height += root.tickLength + Math.max(0, ...tickLabelsContainer.children.map(x => x.height));
|
|
123
|
+
}
|
|
124
|
+
if (label !== "") {
|
|
125
|
+
height += labelText.height + root.spacing;
|
|
126
|
+
}
|
|
127
|
+
return height;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
implicitWidth: {
|
|
131
|
+
switch (root.direction) {
|
|
132
|
+
case Axis.Direction.Left:
|
|
133
|
+
case Axis.Direction.Right:
|
|
134
|
+
let width = 0;
|
|
135
|
+
if (ticks.length > 0) {
|
|
136
|
+
// Can't use childrenRect due to the binding loop it causes
|
|
137
|
+
width += root.tickLength + Math.max(0, ...tickLabelsContainer.children.map(x => x.width));
|
|
138
|
+
}
|
|
139
|
+
if (label !== "") {
|
|
140
|
+
width += labelText.height + root.spacing;
|
|
141
|
+
}
|
|
142
|
+
return width;
|
|
143
|
+
case Axis.Direction.Top:
|
|
144
|
+
case Axis.Direction.Bottom:
|
|
145
|
+
return 100;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
z: 1
|
|
149
|
+
|
|
150
|
+
QuickGraphLib.AxisHelper {
|
|
151
|
+
id: helper
|
|
152
|
+
|
|
153
|
+
height: root.height
|
|
154
|
+
tickLength: 10
|
|
155
|
+
width: root.width
|
|
156
|
+
}
|
|
157
|
+
QQS.Shape {
|
|
158
|
+
id: shape
|
|
159
|
+
|
|
160
|
+
anchors.fill: parent
|
|
161
|
+
|
|
162
|
+
QQS.ShapePath {
|
|
163
|
+
id: myPath
|
|
164
|
+
|
|
165
|
+
strokeColor: "black"
|
|
166
|
+
strokeWidth: 1
|
|
167
|
+
|
|
168
|
+
PathPolyline {
|
|
169
|
+
path: helper.path
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
Item {
|
|
174
|
+
id: tickLabelsContainer
|
|
175
|
+
|
|
176
|
+
Repeater {
|
|
177
|
+
delegate: root.tickDelegate
|
|
178
|
+
model: root.showTickLabels ? helper.tickModel : null
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
Text {
|
|
182
|
+
id: labelText
|
|
183
|
+
|
|
184
|
+
x: {
|
|
185
|
+
switch (root.direction) {
|
|
186
|
+
case Axis.Direction.Left:
|
|
187
|
+
return height / 2;
|
|
188
|
+
case Axis.Direction.Right:
|
|
189
|
+
return root.width - height / 2;
|
|
190
|
+
case Axis.Direction.Top:
|
|
191
|
+
case Axis.Direction.Bottom:
|
|
192
|
+
return root.width / 2;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
y: {
|
|
196
|
+
switch (root.direction) {
|
|
197
|
+
case Axis.Direction.Left:
|
|
198
|
+
case Axis.Direction.Right:
|
|
199
|
+
return root.height / 2;
|
|
200
|
+
case Axis.Direction.Top:
|
|
201
|
+
return height / 2;
|
|
202
|
+
case Axis.Direction.Bottom:
|
|
203
|
+
return root.height - height / 2;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
transform: [
|
|
208
|
+
Translate {
|
|
209
|
+
x: -labelText.width / 2
|
|
210
|
+
y: -labelText.height / 2
|
|
211
|
+
},
|
|
212
|
+
Rotation {
|
|
213
|
+
angle: {
|
|
214
|
+
switch (root.direction) {
|
|
215
|
+
case Axis.Direction.Left:
|
|
216
|
+
return -90;
|
|
217
|
+
case Axis.Direction.Right:
|
|
218
|
+
return 90;
|
|
219
|
+
case Axis.Direction.Top:
|
|
220
|
+
case Axis.Direction.Bottom:
|
|
221
|
+
return 0;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
set(QGL_QML_FILES
|
|
5
|
+
AntialiasingContainer.qml
|
|
6
|
+
Axis.qml
|
|
7
|
+
GraphArea.qml
|
|
8
|
+
ScalingContainer.qml
|
|
9
|
+
ZoomPanHandler.qml
|
|
10
|
+
TickLabel.qml
|
|
11
|
+
ShapeRepeater.qml
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
add_library(QuickGraphLibPlugin SHARED Plugin.cpp)
|
|
15
|
+
target_link_libraries(QuickGraphLibPlugin PRIVATE Qt6::Gui)
|
|
16
|
+
qt_add_qml_module(QuickGraphLib
|
|
17
|
+
URI QuickGraphLib
|
|
18
|
+
SHARED
|
|
19
|
+
VERSION 1.0
|
|
20
|
+
QML_FILES ${QGL_QML_FILES}
|
|
21
|
+
PLUGIN_TARGET QuickGraphLibPlugin
|
|
22
|
+
NO_GENERATE_PLUGIN_SOURCE
|
|
23
|
+
NO_PLUGIN_OPTIONAL
|
|
24
|
+
DEPENDENCIES QtQuick
|
|
25
|
+
SOURCES
|
|
26
|
+
helpers/Helpers.cpp helpers/Helpers.hpp helpers/AxisHelper.hpp helpers/AxisHelper.cpp helpers/Foreign.hpp
|
|
27
|
+
ImageView.hpp ImageView.cpp ColorMaps.hpp ColorMaps.cpp DataTypes.hpp DataTypes.cpp bindings/Bindings.hpp QuickGraphLib.hpp
|
|
28
|
+
)
|
|
29
|
+
set_property(
|
|
30
|
+
TARGET QuickGraphLib
|
|
31
|
+
PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
32
|
+
)
|
|
33
|
+
set_property(
|
|
34
|
+
TARGET QuickGraphLib
|
|
35
|
+
PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
target_compile_definitions(
|
|
39
|
+
QuickGraphLib
|
|
40
|
+
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>
|
|
41
|
+
)
|
|
42
|
+
target_link_libraries(QuickGraphLib PRIVATE Qt6::Quick Qt6::Svg)
|
|
43
|
+
target_include_directories(
|
|
44
|
+
QuickGraphLib
|
|
45
|
+
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/helpers
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
set(QGL_PYTHON_FILES
|
|
49
|
+
__init__.py
|
|
50
|
+
consts.py
|
|
51
|
+
contours.py
|
|
52
|
+
py.typed
|
|
53
|
+
_version.py
|
|
54
|
+
)
|
|
55
|
+
foreach(PYTHON_FILE ${QGL_PYTHON_FILES})
|
|
56
|
+
add_custom_command(
|
|
57
|
+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_FILE}
|
|
58
|
+
COMMAND
|
|
59
|
+
${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${PYTHON_FILE}
|
|
60
|
+
${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_FILE}
|
|
61
|
+
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PYTHON_FILE}
|
|
62
|
+
)
|
|
63
|
+
endforeach()
|
|
64
|
+
list(TRANSFORM QGL_PYTHON_FILES PREPEND "${CMAKE_CURRENT_BINARY_DIR}/")
|
|
65
|
+
add_custom_target(QuickGraphLibPythonFiles ALL DEPENDS ${QGL_PYTHON_FILES})
|
|
66
|
+
|
|
67
|
+
install(
|
|
68
|
+
TARGETS QuickGraphLib
|
|
69
|
+
RUNTIME DESTINATION ${INSTALL_SUBPATH}/QuickGraphLib
|
|
70
|
+
LIBRARY DESTINATION ${INSTALL_SUBPATH}/QuickGraphLib
|
|
71
|
+
)
|
|
72
|
+
install(
|
|
73
|
+
TARGETS QuickGraphLibPlugin
|
|
74
|
+
RUNTIME DESTINATION ${INSTALL_SUBPATH}/QuickGraphLib
|
|
75
|
+
LIBRARY DESTINATION ${INSTALL_SUBPATH}/QuickGraphLib
|
|
76
|
+
)
|
|
77
|
+
install(FILES ${QGL_QML_FILES} DESTINATION ${INSTALL_SUBPATH}/QuickGraphLib)
|
|
78
|
+
install(
|
|
79
|
+
FILES
|
|
80
|
+
${CMAKE_CURRENT_BINARY_DIR}/qmldir
|
|
81
|
+
${CMAKE_CURRENT_BINARY_DIR}/QuickGraphLib.qmltypes
|
|
82
|
+
DESTINATION ${INSTALL_SUBPATH}/QuickGraphLib
|
|
83
|
+
)
|
|
84
|
+
install(FILES ${QGL_PYTHON_FILES} DESTINATION ${INSTALL_SUBPATH}/QuickGraphLib)
|
|
85
|
+
|
|
86
|
+
add_subdirectory(PreFabs)
|
|
87
|
+
add_subdirectory(GraphItems)
|
|
88
|
+
add_subdirectory(bindings)
|