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

Changing freestyle stroke width and color #7

Open
rajesh-ae opened this issue Oct 23, 2018 · 4 comments
Open

Changing freestyle stroke width and color #7

rajesh-ae opened this issue Oct 23, 2018 · 4 comments

Comments

@rajesh-ae
Copy link

Hi,
I was searching for freestyle drawing support inside ipython notebooks and found your amazing extension. I see that the stroke width and color can be changed after making the drawing and selecting that object. Is it possible to change the default stroke width and color?

@riedelcastro
Copy link
Contributor

Oh, yes, that would be great. I don't think I will get to that anytime soon though. If you know javascript, feel free to give it a go.

@rajesh-ae
Copy link
Author

Hi,
Thanks for the reply. I don't know javascript, but I will try tweaking a few things and see if i can find an adhoc solution.

@simonhallstroem
Copy link

Hi,
Did you find a solution? I am also interested in changing stroke width and color with the keyboard before you start drawing. I don't know javascript very well, but I really appreciate this extension and therefore would try to program such a feature. If you have the time, could you give me a hint in wich of the source files I should start?
Kind regards,
Simon

@rajesh-ae
Copy link
Author

rajesh-ae commented Nov 5, 2018

I have not succeeded in making a permanent option to do that. But, as a temporary solution, I was able to change the color and strokewidth in a per session use basis.

Clone the package and install it from a local destination and update the PYTHONPATH.
Open egal-master/egal/static/egal.js in a text editor and go to the end of the file. There is a function 'MakePolyLineContext' which is for the freestyle drawing. Change the strokeWidth parameter (i changed it from 1 to 3, which works for me), stroke parameter "#000" to any other color code you want.

Then running the same installations commands,
jupyter nbextension install --py egal
jupyter nbextension enable --py egal
updates the setting.

If we make changes, running the above commands again and restarting the notebook updates the parameters. We can change similar parameters for line, circle and other drawing elements as well in this file.

Cheers,
Rajesh

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

3 participants