Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrections and a Jupyter notebook #4

Open
Talinf opened this issue Jan 23, 2021 · 0 comments
Open

Corrections and a Jupyter notebook #4

Talinf opened this issue Jan 23, 2021 · 0 comments

Comments

@Talinf
Copy link

Talinf commented Jan 23, 2021

Hi,
thanks for your programs. They are fun and interesting.

I noted some small problems:

a_bit_mondrian.py
Running it in python 3 gives an error in the random.choice function because colors is an iterable and not a list.
By changing line 14 to:
colors = list(color_nums.keys())
the problem is resolved.

double_pendulum.py
1- the PATH directive is not terminated properly which gives an XML error.
to correct simply change line 116 from:
path+= '" style="fill-opacity: 0; stroke-width: 2; stroke: green; filter: url(#glow);"'
to
path+= '" style="fill-opacity: 0; stroke-width: 2; stroke: green; filter: url(#glow);" />'

2- the filter is not applied because the tags in the filter definition are in lowercase instead of camelcase:
fegaussianblur must be change to feGaussianBlur
stddeviation to stdDeviation
femerge to feMerge
femergenode to feMergeNode

Funny thing, the lowercase tags works in a Jupyter notebook.

Speaking of Jupyter notebook, I put all your programs in a single Jupyter notebook to facilitate experimentation.
I included the notebook and a sample pdf file in the attached files.

sample.pdf
svg_play_notebook.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant