ipytree icon indicating copy to clipboard operation
ipytree copied to clipboard

Missing info about allowed icons

Open deeplook opened this issue 6 years ago • 7 comments
trafficstars

I would like to see some decent info in the README about which icons I can use, without looking into the code. I guess some popular icon set will be allowed, but arbitrary SVG would be also cool. ;)

deeplook avatar Mar 14 '19 11:03 deeplook

Yeah I will put more love in the README and I will package it for conda. This is a side project on which I work during my spare time, it doesn't mean I will give up on this, but it means that it will improve slower than other packages.

Concerning the icons it's the same as in ipywidgets, which means font-awesome icons (icons availability depends on the font-awesome version ipywidgets is using). SVG icons are not supported (yet?), PRs welcome :)

martinRenou avatar Mar 14 '19 11:03 martinRenou

@martinRenou Thanks for this nice library! I'm very interested in support for setting arbitrary SVG icons and willing to contribute PR if I can.

Could you give me a very rough outline of the required changes?

ibayer avatar Nov 29 '19 10:11 ibayer

I'm actually not sure myself! ipytree is using jstree https://www.jstree.com, and jstree allows setting an icon from an icon file by giving a path to this file: https://www.jstree.com/api/#/?f=set_icon(obj,%20icon). I'm not sure this supports SVG but I guess it's worth giving it a shot.

The place in ipytree where the icon is set is here: https://github.com/QuantStack/ipytree/blob/master/js/lib/tree.js#L203.

martinRenou avatar Nov 29 '19 10:11 martinRenou

Thanks for the pointers! I'll take a closer look. SVG isn't a hard requirement, most image formats will do.

ibayer avatar Nov 29 '19 10:11 ibayer

Now that our custom node icon option has been merged, having it on pypi would be great. Any idea when the next release will come out?

ibayer avatar Dec 18 '19 10:12 ibayer

Yes, I want to do that on Friday :)

martinRenou avatar Dec 18 '19 10:12 martinRenou

Done, 0.1.5 is on PyPi. I went from 0.1.3 to 0.1.5 directly because I made a broken release in the middle... Please give it a try!! It will be on conda soon.

martinRenou avatar Dec 20 '19 09:12 martinRenou