I am working with a large number of objects and have a few questions:
Is it possible to assign the same class to multiple objects at once (128)?
I tried grouping, assigning a class, and then ungrouping but the class disappeared.
I tried selecting multiple and adding a class but nothing happens when I click the +
Is there a way to use the :even or :odd css selectors?
Does the css filter: brightness() property/attribute not work or is it just me?
For 2 & 3 I plan on having thousands of objects (3000+) to create a chart, with an alternating color scheme (light, dark, light, etc...to discern between chart data). I'm trying to find an efficient way to color the chart so that the colors are set in one place and can in theory all be changed at once as opposed to object by object. Inkscape has an xml editor and css selector so I assumed these were the most efficient method of coloring multiple objects without going one by one. If there is a different method I would be more than happy to try it out. I have a script that actually generates the paths for the data and can give each path/object a class or fill but it's not very fast since I generate it somewhere else and copy it over which is tedious.
You need to provide some further clarification about where you're trying to use these features. (1) implies you're inside Inkscape, whereas I would only expect (2) and (3) to have an effect inside a web browser. Please provide some more details about what exactly you're trying to do, and how you're trying to do it.
Thanks for updating your original post. In future it would be better to add a new post to avoid edits being missed by anyone who isn't actively subscribed to the thread.
It's not clear to me how dynamic you want your chart to be. If it's just a one-off then Inkscape may be suitable. If you want something that can be updated frequently then you might be better off with a web browser and some JavaScript.
In the Inkscape case, I would give each object multiple (space-separated) classes, based on what they represent. So you could include an 'odd' or 'even' class to be able to later select every other path, for example. Whilst CSS offers :nth-child() for this, Inkscape doesn't really have much CSS support, and certainly not for more advanced selectors, so I wouldn't expect to be able to use that approach within the program. With classes set, however, you can use Inkscape's Find/Replace dialog to select all the objects with the 'even' class, for example, so that you can apply a change to all of them at once.
In short, if you want something complex or a process that can be repeated time and time again then you probably want the better CSS and the ability to use JS that comes with a web browser. For something simpler, or a one-off change, you can probably get by with Inkscape, but the methods you have to use may not be what you expect.
Note that Inkscape's CSS Selectors panel is a new addition that, in my experience, is a long way off being useful at the moment. It may have some merit for selecting by class, but even that is hit-and-miss in my initial testing.
If you are able to work with plain javascript / HTML / css. A good option is to build something in a web browser so you can do this interactively.
I use a small page which I can load downloaded free svg clipart from the web. It makes a clickable checkbox label for each tag in the SVG - and adds a dummy ID ( which can be stripped out later ) for all tags will no ID present.
It only requires a few loops of getElementsByTagName or querySelectorAll
The checkboxes toggle the style.setProperty.visibility of the tags, whilst adding a 'markedfordeletion="true" or false attribute to each tag.
I can see the svg image changes in realtime in the browser, and save what I want from the SVG.
If it's something you are doing long term - you could write something. It's also platform independent and requires no software.
I am working with a large number of objects and have a few questions:
For 2 & 3 I plan on having thousands of objects (3000+) to create a chart, with an alternating color scheme (light, dark, light, etc...to discern between chart data). I'm trying to find an efficient way to color the chart so that the colors are set in one place and can in theory all be changed at once as opposed to object by object. Inkscape has an xml editor and css selector so I assumed these were the most efficient method of coloring multiple objects without going one by one. If there is a different method I would be more than happy to try it out. I have a script that actually generates the paths for the data and can give each path/object a class or fill but it's not very fast since I generate it somewhere else and copy it over which is tedious.
2. You can select even/odd by using :nth-child(even)
You need to provide some further clarification about where you're trying to use these features. (1) implies you're inside Inkscape, whereas I would only expect (2) and (3) to have an effect inside a web browser. Please provide some more details about what exactly you're trying to do, and how you're trying to do it.
Thanks for updating your original post. In future it would be better to add a new post to avoid edits being missed by anyone who isn't actively subscribed to the thread.
It's not clear to me how dynamic you want your chart to be. If it's just a one-off then Inkscape may be suitable. If you want something that can be updated frequently then you might be better off with a web browser and some JavaScript.
In the Inkscape case, I would give each object multiple (space-separated) classes, based on what they represent. So you could include an 'odd' or 'even' class to be able to later select every other path, for example. Whilst CSS offers :nth-child() for this, Inkscape doesn't really have much CSS support, and certainly not for more advanced selectors, so I wouldn't expect to be able to use that approach within the program. With classes set, however, you can use Inkscape's Find/Replace dialog to select all the objects with the 'even' class, for example, so that you can apply a change to all of them at once.
In short, if you want something complex or a process that can be repeated time and time again then you probably want the better CSS and the ability to use JS that comes with a web browser. For something simpler, or a one-off change, you can probably get by with Inkscape, but the methods you have to use may not be what you expect.
Note that Inkscape's CSS Selectors panel is a new addition that, in my experience, is a long way off being useful at the moment. It may have some merit for selecting by class, but even that is hit-and-miss in my initial testing.
If you are able to work with plain javascript / HTML / css. A good option is to build something in a web browser so you can do this interactively.
I use a small page which I can load downloaded free svg clipart from the web. It makes a clickable checkbox label for each tag in the SVG - and adds a dummy ID ( which can be stripped out later ) for all tags will no ID present.
It only requires a few loops of getElementsByTagName or querySelectorAll
The checkboxes toggle the style.setProperty.visibility of the tags, whilst adding a 'markedfordeletion="true" or false attribute to each tag.
I can see the svg image changes in realtime in the browser, and save what I want from the SVG.
If it's something you are doing long term - you could write something. It's also platform independent and requires no software.