QuickGraphLib 0.1.0a1__tar.gz → 0.1.0a2__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.
- quickgraphlib-0.1.0a2/CMakeLists.txt +19 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/LICENCE +1 -1
- quickgraphlib-0.1.0a2/MANIFEST.in +3 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/PKG-INFO +9 -4
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/AntialiasingContainer.qml +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/Axis.qml +25 -83
- quickgraphlib-0.1.0a2/QuickGraphLib/CMakeLists.txt +27 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/GraphArea.qml +2 -2
- quickgraphlib-0.1.0a2/QuickGraphLib/GraphItems/AxHLine.qml +34 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/GraphItems/AxHSpan.qml +46 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/GraphItems/AxVLine.qml +34 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/GraphItems/AxVSpan.qml +46 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/GraphItems/BasicLegend.qml +3 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/GraphItems/BasicLegendItem.qml +1 -2
- quickgraphlib-0.1.0a2/QuickGraphLib/GraphItems/CMakeLists.txt +27 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/GraphItems/Contour.qml +3 -2
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/GraphItems/GraphItemDragHandler.qml +2 -2
- quickgraphlib-0.1.0a2/QuickGraphLib/GraphItems/Grid.qml +39 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/GraphItems/Histogram.qml +39 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/GraphItems/Line.qml +3 -4
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/GraphItems/Marker.qml +3 -1
- quickgraphlib-0.1.0a2/QuickGraphLib/GraphItems/helpers/GridHelper.cpp +26 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/GraphItems/helpers/GridHelper.hpp +58 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/GraphItems/helpers/HistogramHelper.cpp +45 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/GraphItems/helpers/HistogramHelper.hpp +59 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/PreFabs/CMakeLists.txt +21 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/PreFabs/XYAxes.qml +6 -14
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/ScalingContainer.qml +1 -1
- quickgraphlib-0.1.0a2/QuickGraphLib/ShapeRepeater.qml +22 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/TickLabel.qml +52 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/ZoomPanHandler.qml +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/doc/export.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/doc/graphitems.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/doc/graphstructure.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/doc/index.qdoc +17 -15
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/doc/interaction.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/doc/module.qdoc +3 -3
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/doc/prefabs.qdoc +1 -1
- quickgraphlib-0.1.0a2/QuickGraphLib/doc/python_helpers.qdoc +46 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/helpers/AxisHelper.cpp +122 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/helpers/AxisHelper.hpp +103 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/helpers/Foreign.hpp +13 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/helpers/Helpers.cpp +332 -0
- quickgraphlib-0.1.0a2/QuickGraphLib/helpers/Helpers.hpp +21 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib.egg-info/PKG-INFO +9 -4
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib.egg-info/SOURCES.txt +20 -18
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/README.md +6 -2
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/AllTheAxes.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/AllTheAxes.qml +2 -3
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/BasicHistogram.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/BasicHistogram.qml +28 -19
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/BasicSinGraph.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/BasicSinGraph.qml +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/BasicSinGraphNoPrefabs.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/BasicSinGraphNoPrefabs.qml +2 -3
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/Complex.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/Complex.qml +29 -16
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/Contours.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/Contours.qml +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/DarkSinGraph.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/DarkSinGraph.qml +2 -2
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/DraggableRegion.qdoc +1 -1
- quickgraphlib-0.1.0a2/examples/DraggableRegion.qml +88 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ExampleGallery.qml +5 -12
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/InvertedAxes.qdoc +2 -2
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/InvertedAxes.qml +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ReadoutLine.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ReadoutLine.qml +10 -7
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ScalingGraph.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ScalingGraph.qml +2 -3
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/Scatter.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/Scatter.qml +1 -1
- quickgraphlib-0.1.0a2/examples/SpansAndLines.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/SpansAndLines.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/SpansAndLines.qml +19 -13
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/Subgraphs.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/Subgraphs.qml +5 -5
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/TwinX.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/TwinX.qml +2 -3
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ZoomableAsImage.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ZoomableAsImage.qml +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ZoomableAxes.qdoc +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ZoomableAxes.qml +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/pyproject.toml +5 -4
- quickgraphlib-0.1.0a2/quickgraphlib_helpers/__init__.py +8 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/quickgraphlib_helpers/consts.py +1 -1
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/quickgraphlib_helpers/contours.py +8 -8
- quickgraphlib-0.1.0a2/setup.py +74 -0
- QuickGraphLib-0.1.0a1/.github/CODEOWNERS +0 -1
- QuickGraphLib-0.1.0a1/.github/workflows/build.yml +0 -124
- QuickGraphLib-0.1.0a1/.gitignore +0 -6
- QuickGraphLib-0.1.0a1/.pre-commit-config.yaml +0 -41
- QuickGraphLib-0.1.0a1/MANIFEST.in +0 -1
- QuickGraphLib-0.1.0a1/QuickGraphLib/GraphItems/AxHLine.qml +0 -25
- QuickGraphLib-0.1.0a1/QuickGraphLib/GraphItems/AxHSpan.qml +0 -28
- QuickGraphLib-0.1.0a1/QuickGraphLib/GraphItems/AxVLine.qml +0 -25
- QuickGraphLib-0.1.0a1/QuickGraphLib/GraphItems/AxVSpan.qml +0 -28
- QuickGraphLib-0.1.0a1/QuickGraphLib/GraphItems/Grid.qml +0 -58
- QuickGraphLib-0.1.0a1/QuickGraphLib/GraphItems/Histogram.qml +0 -50
- QuickGraphLib-0.1.0a1/QuickGraphLib/GraphItems/qmldir +0 -16
- QuickGraphLib-0.1.0a1/QuickGraphLib/Helpers.js +0 -172
- QuickGraphLib-0.1.0a1/QuickGraphLib/PreFabs/qmldir +0 -5
- QuickGraphLib-0.1.0a1/QuickGraphLib/doc/AxesGridLayout.drawio +0 -49
- QuickGraphLib-0.1.0a1/QuickGraphLib/doc/python_helpers.qdoc +0 -73
- QuickGraphLib-0.1.0a1/QuickGraphLib/qmldir +0 -10
- QuickGraphLib-0.1.0a1/activate_venv.ps1 +0 -1
- QuickGraphLib-0.1.0a1/docs/build_docs.py +0 -38
- QuickGraphLib-0.1.0a1/docs/config.qdocconf +0 -44
- QuickGraphLib-0.1.0a1/docs/style.css +0 -164
- QuickGraphLib-0.1.0a1/examples/DraggableRegion.qml +0 -79
- QuickGraphLib-0.1.0a1/examples/SpansAndLines.png +0 -0
- QuickGraphLib-0.1.0a1/examples/gallery.py +0 -43
- QuickGraphLib-0.1.0a1/quickgraphlib_helpers/__init__.py +0 -8
- QuickGraphLib-0.1.0a1/quickgraphlib_helpers/export.py +0 -171
- QuickGraphLib-0.1.0a1/requirements.txt +0 -32
- QuickGraphLib-0.1.0a1/run_qmllint.ps1 +0 -8
- QuickGraphLib-0.1.0a1/setup_venv.ps1 +0 -3
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/doc/AxesGridLayout.svg +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib.egg-info/dependency_links.txt +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib.egg-info/requires.txt +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib.egg-info/top_level.txt +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/AllTheAxes.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/BasicHistogram.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/BasicSinGraph.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/BasicSinGraphNoPrefabs.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/Complex.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/Contours.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/DarkSinGraph.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/DraggableRegion.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ExampleGallery.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/InvertedAxes.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ReadoutLine.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ScalingGraph.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/Scatter.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/Subgraphs.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/TwinX.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ZoomableAsImage.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/examples/ZoomableAxes.png +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/quickgraphlib_helpers/py.typed +0 -0
- {QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/setup.cfg +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
cmake_minimum_required(VERSION 3.16)
|
|
5
|
+
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE)
|
|
6
|
+
|
|
7
|
+
project(qmlmodule VERSION 1.0.0 LANGUAGES CXX)
|
|
8
|
+
|
|
9
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
10
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
11
|
+
|
|
12
|
+
if(NOT INSTALL_SUBPATH)
|
|
13
|
+
set(INSTALL_SUBPATH ${CMAKE_INSTALL_LIBDIR}/qml CACHE STRING "Install subpath (defaults to lib/qml)")
|
|
14
|
+
endif()
|
|
15
|
+
|
|
16
|
+
find_package(Qt6 REQUIRED COMPONENTS Quick Svg)
|
|
17
|
+
qt_standard_project_setup(REQUIRES 6.5)
|
|
18
|
+
|
|
19
|
+
add_subdirectory(QuickGraphLib)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2024
|
|
3
|
+
Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: QuickGraphLib
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a2
|
|
4
4
|
Summary: A scientific graphing library for QtQuick
|
|
5
5
|
Author-email: Matthew Joyce <matthew.joyce@refeyn.com>
|
|
6
6
|
License: MIT License
|
|
7
7
|
|
|
8
|
-
Copyright (c) 2024
|
|
8
|
+
Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
9
9
|
|
|
10
10
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
11
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -26,6 +26,7 @@ License: MIT License
|
|
|
26
26
|
SOFTWARE.
|
|
27
27
|
Project-URL: Homepage, https://github.com/refeyn/QuickGraphLib
|
|
28
28
|
Project-URL: Issues, https://github.com/refeyn/QuickGraphLib/issues
|
|
29
|
+
Project-URL: Documentation, https://refeyn.github.io/QuickGraphLib
|
|
29
30
|
Project-URL: Source, https://github.com/refeyn/QuickGraphLib
|
|
30
31
|
Classifier: Development Status :: 3 - Alpha
|
|
31
32
|
Classifier: Environment :: X11 Applications :: Qt
|
|
@@ -54,9 +55,13 @@ Requires-Dist: pytest-cov; extra == "analyse"
|
|
|
54
55
|
|
|
55
56
|
A scientific graphing library for [QtQuick](https://doc.qt.io/qt-6/qtquick-index.html) using Qt6.
|
|
56
57
|
|
|
58
|
+
Links:
|
|
59
|
+
- [Online documentation](https://refeyn.github.io/QuickGraphLib)
|
|
60
|
+
- [PyPI page](https://pypi.org/project/QuickGraphLib/)
|
|
61
|
+
|
|
57
62
|
Key advantages:
|
|
58
63
|
|
|
59
|
-
- Written in
|
|
64
|
+
- Written in C++ and QML (with some optional Python helpers), so it can be used in both C++ and Python projects
|
|
60
65
|
- QtQuick's hardware-based rendering makes this library render very fast
|
|
61
66
|
- Support for line graphs, histograms, contour plots and more
|
|
62
67
|
- Interactivity supported natively though declarative bindings and QtQuick
|
|
@@ -70,4 +75,4 @@ The example gallery can be run using (provided the Python environment has [PySid
|
|
|
70
75
|
python examples\gallery.py
|
|
71
76
|
```
|
|
72
77
|
|
|
73
|
-
<p align="center"><img src="
|
|
78
|
+
<p align="center"><img src="https://github.com/refeyn/QuickGraphLib/assets/103422031/56fdff62-ef77-4184-9f43-59a76b92d728" width="80%"></p>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: Copyright (c) 2024
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
pragma ComponentBehavior: Bound
|
|
5
5
|
import QtQuick
|
|
6
6
|
import QtQuick.Shapes as QQS
|
|
7
|
+
import QuickGraphLib as QuickGraphLib
|
|
7
8
|
|
|
8
9
|
/*!
|
|
9
10
|
\qmltype Axis
|
|
@@ -22,13 +23,11 @@ Item {
|
|
|
22
23
|
Bottom
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
property list<point> _path: _calculateTickPath(ticks, direction, width, height, dataTransform)
|
|
26
|
-
property list<int> _tickPositions
|
|
27
26
|
/*!
|
|
28
27
|
TODO
|
|
29
28
|
\sa {GraphArea::dataTransform}
|
|
30
29
|
*/
|
|
31
|
-
|
|
30
|
+
property alias dataTransform: helper.dataTransform
|
|
32
31
|
/*! TODO */
|
|
33
32
|
property int decimalPoints: 2
|
|
34
33
|
/*! TODO
|
|
@@ -39,7 +38,7 @@ Item {
|
|
|
39
38
|
\value Axis.Direction.Top Axis above of the GraphArea
|
|
40
39
|
\value Axis.Direction.Bottom Axis below of the GraphArea
|
|
41
40
|
*/
|
|
42
|
-
|
|
41
|
+
property alias direction: helper.direction
|
|
43
42
|
/*! TODO */
|
|
44
43
|
property alias label: labelText.text
|
|
45
44
|
/*! TODO */
|
|
@@ -55,45 +54,20 @@ Item {
|
|
|
55
54
|
/*! TODO */
|
|
56
55
|
property alias strokeWidth: myPath.strokeWidth
|
|
57
56
|
/*! TODO */
|
|
57
|
+
property Component tickDelegate: TickLabel {
|
|
58
|
+
color: root.labelColor
|
|
59
|
+
decimalPoints: root.decimalPoints
|
|
60
|
+
direction: root.direction
|
|
61
|
+
font: root.labelFont
|
|
62
|
+
}
|
|
63
|
+
/*! TODO */
|
|
58
64
|
property color tickLabelColor: labelColor
|
|
59
65
|
/*! TODO */
|
|
60
66
|
property font tickLabelFont: labelFont
|
|
61
67
|
/*! TODO */
|
|
62
|
-
property
|
|
68
|
+
property alias tickLength: helper.tickLength
|
|
63
69
|
/*! TODO */
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
function _calculateTickPath(ticks, direction: int, width: double, height: double, dataTransform) {
|
|
67
|
-
const longAxis = direction == Axis.Direction.Top || direction == Axis.Direction.Bottom ? width : height;
|
|
68
|
-
let transformedTicks = ticks.map(t => dataTransform.map(Qt.point(t, t))[direction == Axis.Direction.Top || direction == Axis.Direction.Bottom ? "x" : "y"]);
|
|
69
|
-
|
|
70
|
-
// Calculate everything as if we were a bottom axis
|
|
71
|
-
let points = [Qt.point(0, 0)], tickPositions = [];
|
|
72
|
-
transformedTicks.forEach(t => {
|
|
73
|
-
if (t >= -0.5 && t <= longAxis + 0.5) {
|
|
74
|
-
points.push(Qt.point(t, 0));
|
|
75
|
-
points.push(Qt.point(t, root.tickLength));
|
|
76
|
-
points.push(Qt.point(t, 0));
|
|
77
|
-
tickPositions.push(points.length - 2);
|
|
78
|
-
} else {
|
|
79
|
-
tickPositions.push(-1);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
points.push(Qt.point(longAxis, 0));
|
|
83
|
-
_tickPositions = tickPositions;
|
|
84
|
-
|
|
85
|
-
// Transform into the correct positions
|
|
86
|
-
switch (root.direction) {
|
|
87
|
-
case Axis.Direction.Left:
|
|
88
|
-
return points.map(p => Qt.point(width - p.y, p.x));
|
|
89
|
-
case Axis.Direction.Right:
|
|
90
|
-
return points.map(p => Qt.point(p.y, p.x));
|
|
91
|
-
case Axis.Direction.Top:
|
|
92
|
-
return points.map(p => Qt.point(p.x, height - p.y));
|
|
93
|
-
case Axis.Direction.Bottom:
|
|
94
|
-
return points;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
70
|
+
property alias ticks: helper.ticks
|
|
97
71
|
|
|
98
72
|
implicitHeight: {
|
|
99
73
|
switch (root.direction) {
|
|
@@ -106,7 +80,7 @@ Item {
|
|
|
106
80
|
if (ticks.length > 0) {
|
|
107
81
|
height += root.tickLength + Math.max(0, ...[...Array(tickLabels.count).keys()].map(i => tickLabels.itemAt(i)?.height));
|
|
108
82
|
}
|
|
109
|
-
if (label
|
|
83
|
+
if (label !== "") {
|
|
110
84
|
height += labelText.height + root.spacing;
|
|
111
85
|
}
|
|
112
86
|
return height;
|
|
@@ -120,7 +94,7 @@ Item {
|
|
|
120
94
|
if (ticks.length > 0) {
|
|
121
95
|
width += root.tickLength + Math.max(0, ...[...Array(tickLabels.count).keys()].map(i => tickLabels.itemAt(i)?.width));
|
|
122
96
|
}
|
|
123
|
-
if (label
|
|
97
|
+
if (label !== "") {
|
|
124
98
|
width += labelText.height + root.spacing;
|
|
125
99
|
}
|
|
126
100
|
return width;
|
|
@@ -131,6 +105,13 @@ Item {
|
|
|
131
105
|
}
|
|
132
106
|
z: 1
|
|
133
107
|
|
|
108
|
+
QuickGraphLib.AxisHelper {
|
|
109
|
+
id: helper
|
|
110
|
+
|
|
111
|
+
height: root.height
|
|
112
|
+
tickLength: 10
|
|
113
|
+
width: root.width
|
|
114
|
+
}
|
|
134
115
|
QQS.Shape {
|
|
135
116
|
id: shape
|
|
136
117
|
|
|
@@ -139,58 +120,19 @@ Item {
|
|
|
139
120
|
QQS.ShapePath {
|
|
140
121
|
id: myPath
|
|
141
122
|
|
|
142
|
-
startX: root._path[0].x
|
|
143
|
-
startY: root._path[0].y
|
|
144
123
|
strokeColor: "black"
|
|
145
124
|
strokeWidth: 1
|
|
146
125
|
|
|
147
126
|
PathPolyline {
|
|
148
|
-
path:
|
|
127
|
+
path: helper.path
|
|
149
128
|
}
|
|
150
129
|
}
|
|
151
130
|
}
|
|
152
131
|
Repeater {
|
|
153
132
|
id: tickLabels
|
|
154
133
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
Text {
|
|
158
|
-
required property int index
|
|
159
|
-
required property double modelData
|
|
160
|
-
|
|
161
|
-
color: root.tickLabelColor
|
|
162
|
-
font: root.tickLabelFont
|
|
163
|
-
leftPadding: 2
|
|
164
|
-
rightPadding: 2
|
|
165
|
-
text: Number(modelData).toFixed(root.decimalPoints)
|
|
166
|
-
visible: root._tickPositions[index] >= 0
|
|
167
|
-
x: {
|
|
168
|
-
let baseX = root._path[root._tickPositions[index]]?.x ?? 0;
|
|
169
|
-
switch (root.direction) {
|
|
170
|
-
case Axis.Direction.Left:
|
|
171
|
-
return baseX - width;
|
|
172
|
-
case Axis.Direction.Right:
|
|
173
|
-
return baseX;
|
|
174
|
-
case Axis.Direction.Top:
|
|
175
|
-
return baseX - width / 2;
|
|
176
|
-
case Axis.Direction.Bottom:
|
|
177
|
-
return baseX - width / 2;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
y: {
|
|
181
|
-
let baseY = root._path[root._tickPositions[index]]?.y ?? 0;
|
|
182
|
-
switch (root.direction) {
|
|
183
|
-
case Axis.Direction.Left:
|
|
184
|
-
return baseY - height / 2;
|
|
185
|
-
case Axis.Direction.Right:
|
|
186
|
-
return baseY - height / 2;
|
|
187
|
-
case Axis.Direction.Top:
|
|
188
|
-
return baseY - height;
|
|
189
|
-
case Axis.Direction.Bottom:
|
|
190
|
-
return baseY;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
134
|
+
delegate: root.tickDelegate
|
|
135
|
+
model: root.showTickLabels ? helper.tickModel : null
|
|
194
136
|
}
|
|
195
137
|
Text {
|
|
196
138
|
id: labelText
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
set(QGL_QML_FILES AntialiasingContainer.qml Axis.qml GraphArea.qml ScalingContainer.qml ZoomPanHandler.qml TickLabel.qml ShapeRepeater.qml)
|
|
5
|
+
qt_add_qml_module(QuickGraphLib
|
|
6
|
+
URI QuickGraphLib
|
|
7
|
+
SHARED
|
|
8
|
+
VERSION 1.0
|
|
9
|
+
QML_FILES ${QGL_QML_FILES}
|
|
10
|
+
SOURCES helpers/Helpers.cpp helpers/Helpers.hpp helpers/AxisHelper.hpp helpers/AxisHelper.cpp helpers/Foreign.hpp
|
|
11
|
+
PLUGIN_TARGET QuickGraphLib
|
|
12
|
+
DEPENDENCIES QtQuick
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
target_compile_definitions(QuickGraphLib PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
|
|
16
|
+
target_link_libraries(QuickGraphLib PRIVATE Qt6::Quick Qt6::Svg)
|
|
17
|
+
target_include_directories(QuickGraphLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/helpers)
|
|
18
|
+
|
|
19
|
+
install(TARGETS QuickGraphLib DESTINATION ${INSTALL_SUBPATH}/QuickGraphLib)
|
|
20
|
+
install(FILES ${QGL_QML_FILES} DESTINATION ${INSTALL_SUBPATH}/QuickGraphLib)
|
|
21
|
+
install(
|
|
22
|
+
FILES ${CMAKE_CURRENT_BINARY_DIR}/qmldir ${CMAKE_CURRENT_BINARY_DIR}/QuickGraphLib.qmltypes
|
|
23
|
+
DESTINATION ${INSTALL_SUBPATH}/QuickGraphLib
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
add_subdirectory(PreFabs)
|
|
27
|
+
add_subdirectory(GraphItems)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: Copyright (c) 2024
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
import QtQuick
|
|
@@ -25,7 +25,7 @@ QQS.Shape {
|
|
|
25
25
|
let mat = rawDataTransform.inverted().times(viewTransform.inverted().times(rawDataTransform));
|
|
26
26
|
// Map corners instead of the whole rect to preserve the invertedness of each axis
|
|
27
27
|
let blCorner = mat.map(Qt.point(viewRect.x, viewRect.y));
|
|
28
|
-
let trCorner = mat.map(Qt.point(viewRect.
|
|
28
|
+
let trCorner = mat.map(Qt.point(viewRect.right, viewRect.bottom));
|
|
29
29
|
return Qt.rect(blCorner.x, blCorner.y, trCorner.x - blCorner.x, trCorner.y - blCorner.y);
|
|
30
30
|
}
|
|
31
31
|
/*!
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import QtQuick
|
|
5
|
+
import QtQuick.Shapes as QQS
|
|
6
|
+
|
|
7
|
+
/*!
|
|
8
|
+
\qmltype AxHLine
|
|
9
|
+
\inqmlmodule QuickGraphLib.GraphItems
|
|
10
|
+
\inherits QtQuick::Shapes::ShapePath
|
|
11
|
+
\brief Displays a horizontal line.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
QQS.ShapePath {
|
|
15
|
+
id: root
|
|
16
|
+
|
|
17
|
+
readonly property point bottomRightPoint: dataTransform.map(Qt.point(viewRect.right, position))
|
|
18
|
+
|
|
19
|
+
/*! TODO */
|
|
20
|
+
required property matrix4x4 dataTransform
|
|
21
|
+
/*! TODO */
|
|
22
|
+
required property double position
|
|
23
|
+
readonly property point topLeftPoint: dataTransform.map(Qt.point(viewRect.left, position))
|
|
24
|
+
/*! TODO */
|
|
25
|
+
required property rect viewRect
|
|
26
|
+
|
|
27
|
+
startX: topLeftPoint.x
|
|
28
|
+
startY: topLeftPoint.y
|
|
29
|
+
|
|
30
|
+
PathLine {
|
|
31
|
+
x: root.bottomRightPoint.x
|
|
32
|
+
y: root.topLeftPoint.y
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import QtQuick
|
|
5
|
+
import QtQuick.Shapes as QQS
|
|
6
|
+
|
|
7
|
+
/*!
|
|
8
|
+
\qmltype AxHSpan
|
|
9
|
+
\inqmlmodule QuickGraphLib.GraphItems
|
|
10
|
+
\inherits QtQuick::Shapes::ShapePath
|
|
11
|
+
\brief Displays a horizontal span.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
QQS.ShapePath {
|
|
15
|
+
id: root
|
|
16
|
+
|
|
17
|
+
readonly property point bottomRightPoint: dataTransform.map(Qt.point(viewRect.right, yMin))
|
|
18
|
+
|
|
19
|
+
/*! TODO */
|
|
20
|
+
required property matrix4x4 dataTransform
|
|
21
|
+
readonly property point topLeftPoint: dataTransform.map(Qt.point(viewRect.left, yMax))
|
|
22
|
+
/*! TODO */
|
|
23
|
+
required property rect viewRect
|
|
24
|
+
/*! TODO */
|
|
25
|
+
required property double yMax
|
|
26
|
+
/*! TODO */
|
|
27
|
+
required property double yMin
|
|
28
|
+
|
|
29
|
+
startX: topLeftPoint.x
|
|
30
|
+
startY: topLeftPoint.y
|
|
31
|
+
strokeColor: "transparent"
|
|
32
|
+
|
|
33
|
+
PathLine {
|
|
34
|
+
x: root.bottomRightPoint.x + root.strokeWidth
|
|
35
|
+
y: root.topLeftPoint.y
|
|
36
|
+
}
|
|
37
|
+
// Would be much nicer to use PathMove, but then the whole rect is not filled
|
|
38
|
+
PathLine {
|
|
39
|
+
x: root.bottomRightPoint.x + root.strokeWidth
|
|
40
|
+
y: root.bottomRightPoint.y
|
|
41
|
+
}
|
|
42
|
+
PathLine {
|
|
43
|
+
x: root.topLeftPoint.x
|
|
44
|
+
y: root.bottomRightPoint.y
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import QtQuick
|
|
5
|
+
import QtQuick.Shapes as QQS
|
|
6
|
+
|
|
7
|
+
/*!
|
|
8
|
+
\qmltype AxVLine
|
|
9
|
+
\inqmlmodule QuickGraphLib.GraphItems
|
|
10
|
+
\inherits QtQuick::Rectangle
|
|
11
|
+
\brief Displays an vertical line.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
QQS.ShapePath {
|
|
15
|
+
id: root
|
|
16
|
+
|
|
17
|
+
readonly property point bottomRightPoint: dataTransform.map(Qt.point(position, viewRect.top))
|
|
18
|
+
|
|
19
|
+
/*! TODO */
|
|
20
|
+
required property matrix4x4 dataTransform
|
|
21
|
+
/*! TODO */
|
|
22
|
+
required property double position
|
|
23
|
+
readonly property point topLeftPoint: dataTransform.map(Qt.point(position, viewRect.bottom))
|
|
24
|
+
/*! TODO */
|
|
25
|
+
required property rect viewRect
|
|
26
|
+
|
|
27
|
+
startX: topLeftPoint.x
|
|
28
|
+
startY: topLeftPoint.y
|
|
29
|
+
|
|
30
|
+
PathLine {
|
|
31
|
+
x: root.topLeftPoint.x
|
|
32
|
+
y: root.bottomRightPoint.y + root.strokeWidth
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import QtQuick
|
|
5
|
+
import QtQuick.Shapes as QQS
|
|
6
|
+
|
|
7
|
+
/*!
|
|
8
|
+
\qmltype AxVSpan
|
|
9
|
+
\inqmlmodule QuickGraphLib.GraphItems
|
|
10
|
+
\inherits QtQuick::Shapes::ShapePath
|
|
11
|
+
\brief Displays an vertical span.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
QQS.ShapePath {
|
|
15
|
+
id: root
|
|
16
|
+
|
|
17
|
+
readonly property point bottomRightPoint: dataTransform.map(Qt.point(xMax, viewRect.top))
|
|
18
|
+
|
|
19
|
+
/*! TODO */
|
|
20
|
+
required property matrix4x4 dataTransform
|
|
21
|
+
readonly property point topLeftPoint: dataTransform.map(Qt.point(xMin, viewRect.bottom))
|
|
22
|
+
/*! TODO */
|
|
23
|
+
required property rect viewRect
|
|
24
|
+
/*! TODO */
|
|
25
|
+
required property double xMax
|
|
26
|
+
/*! TODO */
|
|
27
|
+
required property double xMin
|
|
28
|
+
|
|
29
|
+
startX: topLeftPoint.x
|
|
30
|
+
startY: topLeftPoint.y
|
|
31
|
+
strokeColor: "transparent"
|
|
32
|
+
|
|
33
|
+
PathLine {
|
|
34
|
+
x: root.topLeftPoint.x
|
|
35
|
+
y: root.bottomRightPoint.y + root.strokeWidth
|
|
36
|
+
}
|
|
37
|
+
// Would be much nicer to use PathMove, but then the whole rect is not filled
|
|
38
|
+
PathLine {
|
|
39
|
+
x: root.bottomRightPoint.x
|
|
40
|
+
y: root.bottomRightPoint.y + root.strokeWidth
|
|
41
|
+
}
|
|
42
|
+
PathLine {
|
|
43
|
+
x: root.bottomRightPoint.x
|
|
44
|
+
y: root.topLeftPoint.y
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: Copyright (c) 2024
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
import QtQuick
|
|
@@ -8,6 +8,8 @@ import QtQuick
|
|
|
8
8
|
\inqmlmodule QuickGraphLib.GraphItems
|
|
9
9
|
\inherits QtQuick::Rectangle
|
|
10
10
|
\brief Displays a simple legend.
|
|
11
|
+
|
|
12
|
+
\note This graph item does not inherit from ShapePath, unlike other graph items.
|
|
11
13
|
*/
|
|
12
14
|
|
|
13
15
|
Rectangle {
|
{QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/GraphItems/BasicLegendItem.qml
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: Copyright (c) 2024
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
import QtQuick
|
|
@@ -17,7 +17,6 @@ Row {
|
|
|
17
17
|
property color fillColor: "transparent"
|
|
18
18
|
/*! TODO */
|
|
19
19
|
property Gradient fillGradient: null
|
|
20
|
-
|
|
21
20
|
/*! TODO */
|
|
22
21
|
property color strokeColor: "black"
|
|
23
22
|
/*! TODO */
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
set(QGL_GI_QML_FILES
|
|
5
|
+
AxHLine.qml AxVLine.qml BasicLegend.qml GraphItemDragHandler.qml Histogram.qml Marker.qml
|
|
6
|
+
AxHSpan.qml AxVSpan.qml BasicLegendItem.qml Contour.qml Grid.qml Line.qml
|
|
7
|
+
)
|
|
8
|
+
qt_add_qml_module(QuickGraphLibGraphItems
|
|
9
|
+
URI QuickGraphLib.GraphItems
|
|
10
|
+
SHARED
|
|
11
|
+
VERSION 1.0
|
|
12
|
+
QML_FILES ${QGL_GI_QML_FILES}
|
|
13
|
+
SOURCES helpers/HistogramHelper.cpp helpers/HistogramHelper.hpp helpers/GridHelper.hpp helpers/GridHelper.cpp
|
|
14
|
+
PLUGIN_TARGET QuickGraphLibGraphItems
|
|
15
|
+
DEPENDENCIES QtQuick QuickGraphLib
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
target_compile_definitions(QuickGraphLibGraphItems PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
|
|
19
|
+
target_link_libraries(QuickGraphLibGraphItems PRIVATE Qt6::Quick)
|
|
20
|
+
target_include_directories(QuickGraphLibGraphItems PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/helpers)
|
|
21
|
+
|
|
22
|
+
install(TARGETS QuickGraphLibGraphItems DESTINATION ${INSTALL_SUBPATH}/QuickGraphLib/GraphItems)
|
|
23
|
+
install(FILES ${QGL_GI_QML_FILES} DESTINATION ${INSTALL_SUBPATH}/QuickGraphLib/GraphItems)
|
|
24
|
+
install(
|
|
25
|
+
FILES ${CMAKE_CURRENT_BINARY_DIR}/qmldir ${CMAKE_CURRENT_BINARY_DIR}/QuickGraphLibGraphItems.qmltypes
|
|
26
|
+
DESTINATION ${INSTALL_SUBPATH}/QuickGraphLib/GraphItems
|
|
27
|
+
)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: Copyright (c) 2024
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
import QtQuick
|
|
5
5
|
import QtQuick.Shapes as QQS
|
|
6
|
+
import QuickGraphLib as QuickGraphLib
|
|
6
7
|
|
|
7
8
|
/*!
|
|
8
9
|
\qmltype Contours
|
|
@@ -28,6 +29,6 @@ QQS.ShapePath {
|
|
|
28
29
|
joinStyle: QQS.ShapePath.RoundJoin
|
|
29
30
|
|
|
30
31
|
PathMultiline {
|
|
31
|
-
paths: root.paths.map(ps =>
|
|
32
|
+
paths: root.paths.map(ps => QuickGraphLib.Helpers.mapPoints(ps, root.dataTransform))
|
|
32
33
|
}
|
|
33
34
|
}
|
{QuickGraphLib-0.1.0a1 → quickgraphlib-0.1.0a2}/QuickGraphLib/GraphItems/GraphItemDragHandler.qml
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: Copyright (c) 2024
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
import QtQuick
|
|
@@ -26,7 +26,7 @@ MouseArea {
|
|
|
26
26
|
|
|
27
27
|
onPositionChanged: event => {
|
|
28
28
|
if (dragging) {
|
|
29
|
-
moved(dataTransform.inverted().mapRect(Qt.rect(
|
|
29
|
+
moved(dataTransform.inverted().mapRect(Qt.rect(root.x + event.x - _startDragPos.x, parent.y + root.y - _startDragPos.y, _startDragPos.width, _startDragPos.height)));
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
onPressed: event => {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import QtQuick
|
|
5
|
+
import QtQuick.Shapes as QQS
|
|
6
|
+
import QuickGraphLib.GraphItems as QGLGraphItems
|
|
7
|
+
|
|
8
|
+
/*!
|
|
9
|
+
\qmltype Grid
|
|
10
|
+
\inqmlmodule QuickGraphLib.GraphItems
|
|
11
|
+
\inherits QtQuick::Shapes::ShapePath
|
|
12
|
+
\brief Displays a grid in the background of a graph.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
QQS.ShapePath {
|
|
16
|
+
id: root
|
|
17
|
+
|
|
18
|
+
property QGLGraphItems.GridHelper _helper: QGLGraphItems.GridHelper {
|
|
19
|
+
id: helper
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/*! TODO */
|
|
24
|
+
property alias dataTransform: helper.dataTransform
|
|
25
|
+
/*! TODO */
|
|
26
|
+
property alias viewRect: helper.viewRect
|
|
27
|
+
/*! TODO */
|
|
28
|
+
property alias xTicks: helper.xTicks
|
|
29
|
+
/*! TODO */
|
|
30
|
+
property alias yTicks: helper.yTicks
|
|
31
|
+
|
|
32
|
+
capStyle: QQS.ShapePath.RoundCap
|
|
33
|
+
fillColor: "transparent"
|
|
34
|
+
joinStyle: QQS.ShapePath.RoundJoin
|
|
35
|
+
|
|
36
|
+
PathMultiline {
|
|
37
|
+
paths: helper.paths
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import QtQuick
|
|
5
|
+
import QtQuick.Shapes as QQS
|
|
6
|
+
import QuickGraphLib.GraphItems as QGLGraphItems
|
|
7
|
+
|
|
8
|
+
/*!
|
|
9
|
+
\qmltype Histogram
|
|
10
|
+
\inqmlmodule QuickGraphLib.GraphItems
|
|
11
|
+
\inherits QtQuick::Shapes::ShapePath
|
|
12
|
+
\brief Displays a histogram.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
QQS.ShapePath {
|
|
16
|
+
id: root
|
|
17
|
+
|
|
18
|
+
property QGLGraphItems.HistogramHelper _helper: QGLGraphItems.HistogramHelper {
|
|
19
|
+
id: helper
|
|
20
|
+
|
|
21
|
+
vertical: false
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/*! TODO */
|
|
25
|
+
property alias bins: helper.bins
|
|
26
|
+
/*! TODO */
|
|
27
|
+
property alias dataTransform: helper.dataTransform
|
|
28
|
+
/*! TODO */
|
|
29
|
+
property alias heights: helper.heights
|
|
30
|
+
/*! TODO */
|
|
31
|
+
property alias vertical: helper.vertical
|
|
32
|
+
|
|
33
|
+
capStyle: QQS.ShapePath.RoundCap
|
|
34
|
+
joinStyle: QQS.ShapePath.RoundJoin
|
|
35
|
+
|
|
36
|
+
PathPolyline {
|
|
37
|
+
path: root._helper.path
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: Copyright (c) 2024
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) 2024 Refeyn Ltd and other QuickGraphLib contributors
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
import QtQuick
|
|
5
5
|
import QtQuick.Shapes as QQS
|
|
6
|
+
import QuickGraphLib as QuickGraphLib
|
|
6
7
|
|
|
7
8
|
/*!
|
|
8
9
|
\qmltype Line
|
|
@@ -49,10 +50,8 @@ QQS.ShapePath {
|
|
|
49
50
|
capStyle: QQS.ShapePath.RoundCap
|
|
50
51
|
fillColor: "transparent"
|
|
51
52
|
joinStyle: QQS.ShapePath.RoundJoin
|
|
52
|
-
startX: root.path[0].x
|
|
53
|
-
startY: root.path[0].y
|
|
54
53
|
|
|
55
54
|
PathPolyline {
|
|
56
|
-
path: root.path
|
|
55
|
+
path: QuickGraphLib.Helpers.mapPoints(root.path, root.dataTransform)
|
|
57
56
|
}
|
|
58
57
|
}
|