Skip to content

Commit

Permalink
moved class Segments to element/geom.py
Browse files Browse the repository at this point in the history
  • Loading branch information
poplarShift committed Feb 27, 2019
1 parent 66ef0d1 commit d6d7df7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*.o
*.out
*.lock
/build
/doc/Tutorials/*.rst
/doc/Tutorials/example*.svg
/doc/Tutorials/example*.gif
Expand All @@ -25,4 +26,4 @@
holoviews.rc
/examples/assets/
ghostdriver.log
holoviews/.version
holoviews/.version
13 changes: 1 addition & 12 deletions holoviews/element/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from ..core import util
from ..core import Dimension, Dataset, Element2D
from ..core.data import GridInterface
from .geom import Points, Geometry, VectorField # noqa: backward compatible import
from .geom import Points, Geometry, Segments, VectorField # noqa: backward compatible import
from .stats import BoxWhisker # noqa: backward compatible import


Expand Down Expand Up @@ -281,14 +281,3 @@ def stack(cls, areas):
new_type=Area)
baseline = baseline + y
return stacked

class Segments(Geometry):
"""
"""
group = param.String(default='Segments', constant=True)

kdims = param.List(default=[Dimension('x0'), Dimension('y0'),
Dimension('x1'), Dimension('y1')],
bounds=(4, None), constant=True, doc="""
Segments represent lines in given by x- and y-
coordinates in a 2D space.""")
15 changes: 14 additions & 1 deletion holoviews/element/geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Points(Geometry):

class VectorField(Geometry):
"""
A VectorField represents a set of vectors in 2D spac with an
A VectorField represents a set of vectors in 2D space with an
associated angle, as well as an optional magnitude and any number
of other value dimensions. The angles are assumed to be defined in
radians and by default the magnitude is assumed to be normalized
Expand All @@ -50,3 +50,16 @@ class VectorField(Geometry):

vdims = param.List(default=[Dimension('Angle', cyclic=True, range=(0,2*np.pi)),
Dimension('Magnitude')], bounds=(1, None))


class Segments(Geometry):
"""
Segments represent a collection of lines in 2D space.
"""
group = param.String(default='Segments', constant=True)

kdims = param.List(default=[Dimension('x0'), Dimension('y0'),
Dimension('x1'), Dimension('y1')],
bounds=(4, None), constant=True, doc="""
Segments represent lines given by x- and y-
coordinates in 2D space.""")

0 comments on commit d6d7df7

Please sign in to comment.