Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EO Time Series Viewer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin Jakimow
EO Time Series Viewer
Commits
95bddca0
Commit
95bddca0
authored
11 years ago
by
Mikhail Terekhov
Browse files
Options
Downloads
Patches
Plain Diff
In ArrowItem allow individual parameter change through setStyle call.
parent
fe11e6c1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/Arrow.py
+2
-1
2 additions, 1 deletion
examples/Arrow.py
pyqtgraph/graphicsItems/ArrowItem.py
+6
-3
6 additions, 3 deletions
pyqtgraph/graphicsItems/ArrowItem.py
pyqtgraph/graphicsItems/CurvePoint.py
+1
-1
1 addition, 1 deletion
pyqtgraph/graphicsItems/CurvePoint.py
with
9 additions
and
5 deletions
examples/Arrow.py
+
2
−
1
View file @
95bddca0
...
...
@@ -2,7 +2,7 @@
"""
Display an animated arrowhead following a curve.
This example uses the CurveArrow class, which is a combination
of ArrowItem and CurvePoint.
of ArrowItem and CurvePoint.
To place a static arrow anywhere in a scene, use ArrowItem.
To attach other types of item to a curve, use CurvePoint.
...
...
@@ -45,6 +45,7 @@ p.setRange(QtCore.QRectF(-20, -10, 60, 20))
## Animated arrow following curve
c
=
p2
.
plot
(
x
=
np
.
sin
(
np
.
linspace
(
0
,
2
*
np
.
pi
,
1000
)),
y
=
np
.
cos
(
np
.
linspace
(
0
,
6
*
np
.
pi
,
1000
)))
a
=
pg
.
CurveArrow
(
c
)
a
.
setStyle
(
headLen
=
40
)
p2
.
addItem
(
a
)
anim
=
a
.
makeAnimation
(
loop
=-
1
)
anim
.
start
()
...
...
This diff is collapsed.
Click to expand it.
pyqtgraph/graphicsItems/ArrowItem.py
+
6
−
3
View file @
95bddca0
...
...
@@ -70,13 +70,16 @@ class ArrowItem(QtGui.QGraphicsPathItem):
brush The brush used to fill the arrow.
================= =================================================
"""
self
.
opts
=
opts
try
:
self
.
opts
.
update
(
opts
)
except
AttributeError
:
self
.
opts
=
opts
opt
=
dict
([(
k
,
self
.
opts
[
k
])
for
k
in
[
'
headLen
'
,
'
tipAngle
'
,
'
baseAngle
'
,
'
tailLen
'
,
'
tailWidth
'
]])
self
.
path
=
fn
.
makeArrowPath
(
**
opt
)
self
.
setPath
(
self
.
path
)
if
opts
[
'
pxMode
'
]:
if
self
.
opts
[
'
pxMode
'
]:
self
.
setFlags
(
self
.
flags
()
|
self
.
ItemIgnoresTransformations
)
else
:
self
.
setFlags
(
self
.
flags
()
&
~
self
.
ItemIgnoresTransformations
)
...
...
@@ -121,4 +124,4 @@ class ArrowItem(QtGui.QGraphicsPathItem):
return
pad
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pyqtgraph/graphicsItems/CurvePoint.py
+
1
−
1
View file @
95bddca0
...
...
@@ -112,6 +112,6 @@ class CurveArrow(CurvePoint):
self
.
arrow
=
ArrowItem
.
ArrowItem
(
**
opts
)
self
.
arrow
.
setParentItem
(
self
)
def
setStyle
(
**
opts
):
def
setStyle
(
self
,
**
opts
):
return
self
.
arrow
.
setStyle
(
**
opts
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment