Git Product home page Git Product logo

svgfig's Issues

Support Text on Path

I just downloaded svgfig today, so maybe what I'm asking can already be
done, sorry if that's the case. (And thanks for creating svgfig!!)

What steps will reproduce the problem?
1. Create a text: tbox = Text(1.5, 0.5, "hello")
2. Transform the text: Fig(Fig(tbox, trans="x*cos(y), x*sin(y)")).SVG(...)

What is the expected output? What do you see instead?
I expected the text to be transformed too, but the text was nice and
horizontal.

What version of the product are you using? On what operating system?
1.1.6 (windows)

Please provide any additional information below:

I can understand why transforming text could be troublesome, however, it
would be enough for svgfig to support text on path. I'm thinking on
creating a "Line" and use that as a path. If the Line gets transformed, I
guess the text will be rendered following said transformed line.




Original issue reported on code.google.com by [email protected] on 12 Jun 2008 at 1:40

Documentation incongruency about Ticks()

Hello,
documentation [0] says Ticks has the following defaults: text_defaults, 
tick_start, tick_end, minitick_start, minitick_end, text_start, text_angle.

[0]: http://code.google.com/p/svgfig/wiki/ClassTicks

However:

>>> from svgfig import *
>>> Ticks.defaults
{'stroke-width': '0.25pt'}
>>>

Am I doing something totally wrong? :-)

Original issue reported on code.google.com by [email protected] on 5 Sep 2010 at 8:46

Misc. formatting issues in the source code

Not quite defects, more a suggestion for some cosmetic improvements:

1. make src PEP8 compliant (of course compliance is not mandatory, but as
many developers follow it, rather a "nice to have")

2. remove trailing blanks

3. remove CR/LF line endings (use LF only) (CR/LF looks ugly in some
non-windows editors)

If such improvements are welcome, I am offering to help.

BTW, (in case you use Vim) there is a nice Vim PEP8 plugin, see
http://moinmo.in/CodingStyle

Original issue reported on code.google.com by [email protected] on 30 Nov 2008 at 12:19

Licence Issues

Hi I am developing a Commercial application that I would like to use your
library so I don't need to implement my own svg output functions.

Is it possible for you to distribute your code under a less restrictive
license like lgpl or MIT or Python licences

Stu



Original issue reported on code.google.com by [email protected] on 12 Jun 2008 at 2:41

_viewer.so segfaults - svgfig2

What steps will reproduce the problem?
1. Build an SVG object 
2. Attempt to view it
3. ??
4. Segfault!

What is the expected output? What do you see instead?
Code sporadically segfaults, should draw to window. Output of build at 
http://pastebin.com/WWWxadbJ.

What version of the product are you using? On what operating system?

SVGFig2, compiled on 10.04 with...
libcairo2-dev                         1.8.10-2ubuntu1 
librsvg2-dev                          2.26.3-0ubuntu1
libpango1.0-dev                       1.28.0-0ubuntu2.2
libglib2.0-dev                        2.24.1-0ubuntu1
libatk1.0-dev                         1.30.0-0ubuntu2.1
libgtk2.0-dev                         2.20.1-0ubuntu2
python-gtk2-dev                       2.17.0-0ubuntu2


Please provide any additional information below.

Replacement _viewer.py - http://pastebin.com/bVNyBiw9
Patch to svg.py - http://pastebin.com/swtRi8cj

Original issue reported on code.google.com by [email protected] on 2 Aug 2011 at 5:16

Cannot delete element when iterating through SVG object

What steps will reproduce the problem?

Example source:

inputDOM = svgfig.load(pvars['inputsvgfile'])
for treeIndex, element in inputDOM:
  if element.__class__ == svgfig.SVG:
    if element.t == "polygon" and pvars['strippolygons']:
      try:
        del inputDOM[treeIndex]
        continue
      except IndexError:
        print treeIndex, element.t, element.attr
        sys.exit(1)

Example input SVG:

<g>
  <polygon id="poly1" ...>
  <polygon id="poly2" ...>
  ...
</g>

What is the expected output? What do you see instead?

I expect that the <polygon> elements will be stripped from the input file.

Instead, I often get IndexErrors of the following sort:

=====
Traceback (most recent call last):
  File "src/polygon2circle.py", line 400, in ?
    main()
  File "src/polygon2circle.py", line 245, in main
    del inputDOM[treeIndex]
  File "/home/areynolds/opt/lib/python2.4/site-packages/svgfig.py", line
165, in __delitem__
    if isinstance(ti, (int, long, slice)): del obj.sub[ti]
IndexError: list assignment index out of range
=====

What version of the product are you using? On what operating system?

Equivalent of 1.1.5

Please provide any additional information below.

I may be trying to do something I shouldn't, wrt to Python iterators.

For fun, one thing I tried was a function called decrementLastItemInTuple
to take the treeIndex tuple and decrement its last index by 1:

inputDOM = svgfig.load(pvars['inputsvgfile'])
for treeIndex, element in inputDOM:
  if element.__class__ == svgfig.SVG:
    if element.t == "polygon" and pvars['strippolygons']:
      try:
        del inputDOM[treeIndex]
        treeIndex = decrementLastItemInTuple(treeIndex)
        continue
      except IndexError:
        print treeIndex, element.t, element.attr
        sys.exit(1)

It's not efficient to rebuild the tuple on each loop, but the thought was
that "moving" the treeIndex "pointer" back would help prevent the
out-of-range problem.

But it seems like the iterator ignores my reassignment of treeIndex, and
keeps chugging through the rest of that level of elements.

I'm a bit new to Python, so I probably shouldn't be doing this in an iterator?

Is there a better way to filter out nodes of a certain type while iterating
through the tree?

A cheap approach I took which does seem to work is to do:

inputDOM = svgfig.load(pvars['inputsvgfile'])
for treeIndex, element in inputDOM:
  if element.__class__ == svgfig.SVG:
    if element.t == "polygon" and pvars['strippolygons']:
      inputDOM[treeIndex] = "<!-- deleted -->"
      continue
...
xml.dom.ext.PrettyPrint[inputDOMfile]

The comments seem to get stripped out after going through PrettyPrint.

Original issue reported on code.google.com by [email protected] on 12 Mar 2008 at 8:50

[svgfig 2.0alpha2] problem with function smooth (pathdata.py)

The function smooth in pathdata.py doesn't seem to work correct.
It doesnt return a list which can be used for the "d" attribute in SVG("path")

furthermore adding loop=true as keyword argument throws an TypeError exception

What steps will reproduce the problem?
>>> s_p = smooth((1, 0), (2, 1), (3, 2))
>>> print s_p
[('M', (1, 0, 0.0, 0.0), (2, 1, 1.0, 1.0))]

>>> s_p = smooth((1, 0), (2, 1), (3, 2), loop=True)
>>> print s_p
Exception:......

What is the expected output? What do you see instead?
In the first case:
[('M', 1, 0), ('C', 1.0, 0.0, 1.6666666666666667, 0.66666666666666674, 2,
1),('C', 2.3333333333333335, 1.3333333333333333, 3.0, 2.0, 3, 2)]

In the second case:
[('M', 1, 0), ('C', 0.83333333333333337, -0.16666666666666666,
1.6666666666666667, 0.66666666666666674, 2, 1), ('C', 2.3333333333333335,
1.3333333333333333, 3.1666666666666665, 2.1666666666666665, 3, 2), ('C',
2.8333333333333335, 1.8333333333333333, 1.1666666666666667,
0.16666666666666666, 1, 0), ('Z',)]


What version of the product are you using? On what operating system?
"SVGFig 2.0.0alpha2; From SVN r365
python '2.5.4 (r254:67916, Mar  7 2009, 17:19:39) \n[GCC 4.2.1 20070719 
[FreeBSD]]'
FreeBSD 7.1-RELEASE-p3

Please provide any additional information below.

The (helper) function velocity isn't called with the right arguments from
smooth.
The call on line 144 of file pathdata.py should read:
return velocity(loop=loop, *zip(x, y, vx, vy))

instead of:
return velocity(zip(x, y, vx, vy), loop)

I didnt check the svgfig 1.x version


Original issue reported on code.google.com by [email protected] on 25 Jun 2009 at 7:20

SVG.Save() on window

What steps will reproduce the problem?
1. Download svgfig
2. write the 'hello world' svg as outlined in tutorial
3. issue the s.save() command

What is the expected output? What do you see instead?
expected to see tmp.svg but error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python26\lib\site-packages\svgfig.py", line 433, in save
    f = codecs.open(fileName, "w", encoding=encoding)
  File "C:\Python26\lib\codecs.py", line 865, in open
    file = __builtin__.open(filename, mode, buffering)
IOError: [Errno 2] No such file or 
directory: 'C:\\home\\AuChan\\Desktop\\tmp.svg

What version of the product are you using? On what operating system?
latest version on window

Please provide any additional information below.
Thank you very much ... 


Original issue reported on code.google.com by [email protected] on 18 Feb 2010 at 11:52

Wish: use title also for axes not only with Frame

Hi

Thanks for this nice library. Currently I try to figure out if I can or how
to use it together with the MoinMoin wiki software to visualize some data
with macros stored in the wiki.

http://moinmo.in/MacroMarket/SvgPlot-1.8

It looks to me that I can only use an axis title if I create a Frame Object
if so I do wish to get this independent from the Frame object. Isn't it not
something which one wants to add to an axis? For example if one wants to
have a different second axis then usually there is a title defined also.

If I have missed something please give me a hint.

cheers
Reimar

Original issue reported on code.google.com by [email protected] on 9 Nov 2008 at 8:52

announcement page info inaccurate?

What steps will reproduce the problem?
1. try to install (python setup.py install) w/o the python-dev package on Ubuntu

What is the expected output? working installation
What do you see instead? broken installation

What version of the product are you using? 2.0alpha2
On what operating system? Ubuntu 13

Please provide any additional information below.

v2 announcement page says _curve "has no dependencies" but I had to install the 
python-dev package so it could find Python.h

Original issue reported on code.google.com by [email protected] on 12 Mar 2014 at 6:07

firefox() not working under windows

What steps will reproduce the problem?
1. crate a plot figure 
2. open it with Plot(...).SVG().firefox()

What is the expected output? What do you see instead?
- expected : firefox opens
- instead : AttributeError: 'module' object has no attribute 'spawnvp'

Version : 1.1.6.zip Os : Windows

execvp is not available under windows


Original issue reported on code.google.com by [email protected] on 18 Mar 2009 at 10:55

Compiler dependency for installing svgfig v2

As of v2, svgfig depends on a C compiler for installation, due to _viewer
and _curve modules. _curve is needed for Curve, Curve is needed for [XY]Axis.

I am looking at svgfig from the perspective of a MoinMoin wiki developer.
We currently use gdchart (v1) to draw some statistics charts.
gdchart v1 is old and has some problems, some linux distributions already
removed it, so we need something new. gdchart v2 doesn't look very healthy
either, so we are looking for alternatives.
Best for us is stuff that is either widely available for many platforms or
stuff that is tiny enough so we can just bundle it with MoinMoin.
As we don't require a C compiler for moin installation, we don't want it
for stuff we bundle either, of course. No big issue on Linux, but Windows
users usually don't have a compiler installed (and we don't want to
distribute compiled stuff either).

Back to svgfig:

_viewer is something we likely won't need, so no big issue with that.

_curve first looked like something we don't need either, but then I saw
that [XY]Axis inherits from Curve and Curve needs _curve, so this IS a
problem as we need Axes.

svgfig v1 seems to not have this problem.

So the question is:
Could one have a fallback python implementation of _curve?
Could one have a easier [XY]Axis not needing Curve?
Same for _viewer?

Original issue reported on code.google.com by [email protected] on 30 Nov 2008 at 12:31

1.1.6 setup.py has wrong version

What steps will reproduce the problem?
python setup.py install

What is the expected output? What do you see instead?
expected to install as svgfig-1.1.6
outcome installs as svgfig-1.1.2

What version of the product are you using? On what operating system?
svgfig-1.1.6

Please provide any additional information below.
Update the setup.py to be the correct version.

Original issue reported on code.google.com by [email protected] on 11 Feb 2014 at 4:44

Strange auto-exclude for labels

From Axes.SVG:

        xmargin = 0.1 * abs(self.ymin - self.ymax)
        xexclude = atx - xmargin, atx + xmargin

        ymargin = 0.1 * abs(self.xmin - self.xmax)
        yexclude = aty - ymargin, aty + ymargin

I tried to make a Plot with x = 1 .. 12 (months) and y = 0 .. 100
(whatever) and wondered why I only saw Okt, Nov, Dec as x labels, but Jan
.. Sep were suppressed somehow.

Looking at the code above, it gets clear why that happens.
But I don't see the sense of that.

I somehow feel that there might be some "x" and "y" at the wrong place.
If the intention is to keep the crossing area (say 10% of the axis length)
of the axes free from labels, the xmargin should be calculated from x
length (and not y length).

Original issue reported on code.google.com by [email protected] on 7 Dec 2008 at 9:11

svgfig.Text() renders list representation of characters instead of string

What steps will reproduce the problem?

Sample code:
----
titleSVGTextElement = svgfig.Text(10, 10, "test").SVG()
parentOfCurrentElement.append(titleSVGTextElement)
----

What is the expected output? What do you see instead?

Expected: Labeled SVG output with the word "test"
Observed: Labeled SVG output with the Python list __repr__ representation:
['t', 'e', 's', 't']

What version of the product are you using? On what operating system?

1.1.4 via Google Code


Please provide any additional information below.

I downloaded the source and changed the Text class's __init__ function here:

self.d. = list(d)

to

self.d = str(d)

I repeated this for the TextGlobal class.

I copied this version of svgfig.py into the Google Code 1.1.4 release, and
then recompiled via setup.py. 

This appeared to resolve the issue.

Original issue reported on code.google.com by [email protected] on 10 Mar 2008 at 9:27

Frame text_xtitle_offset can not be changed from default

What steps will reproduce the problem?

1. Setting the text_xtitle_offset and text_ytitle_offset doesnt move the
text for a frame, stays at default value. 


What is the expected output? What do you see instead?
xtitle and ytitle should move when set away / toward the axis

What version of the product are you using? On what operating system?

svgfig 1.1.6, Ubuntu 8.04

Please provide any additional information below.

There doesnt seem provision in the code to take the value from the
axis_attr dictionary argument to set the local variables text_xtitle_offset
and text_ytitle_offset so they both stay as the default values

I added 2 lines, at line 998:
    if self.axis_attr.has_key("text_xtitle_offset"):
self.text_xtitle_offset = self.axis_attr["text_xtitle_offset"]
    if self.axis_attr.has_key("text_ytitle_offset"):
self.text_ytitle_offset = self.axis_attr["text_ytitle_of

which seem to sort the problem but they're not exactly elegant :P

Just wanted to say thanks for all your hard work in the project, its much
appreciated :)






Original issue reported on code.google.com by [email protected] on 29 May 2008 at 12:10

License for Version 2 of library - Request for Clarification

Hello, according to issue #4, you prefer to keep the license for version 1 as GPL, but could you please clarify which license is used for version 2?
As I understood from the issue referred above, you would use a less restrictive one. Would you be so kind to add the license file or the license header into the source code?
I would like to use it in a commercial product, if you would not object.

Thank you in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.