automeris-io / WebPlotDigitizer

Computer vision assisted tool to extract numerical data from plot images.
https://automeris.io
GNU Affero General Public License v3.0
2.65k stars 363 forks source link

Feature Request: Allow Plugins? #172

Closed billdenney closed 2 years ago

billdenney commented 5 years ago

I have a set of feature requests that I think may be specific to some of my use cases and may create feature bloat within the main WebPlotDigitizer package. While I could make them as feature requests here, I think what may make more sense would be to ask for a plugin architecture to be added where other tools could connect to hooks.

A few examples that I'm interested in that may be specific to my use cases are:

  1. I'd like to add meta-data to the file where extraction is happening. For example, it may be that I'd like to add the URL where the file was received, or for journal articles, I may want to add citation information.
  2. I'd like to add meta-data at the data point, data set, or axis level. Examples here are things like at the axis level, I'd like to be able to indicate that the axis is Figure 3 (possible at the axis naming level right now, I know) and I'd like to add the units of the x- and y-axes (or more generally of any axis dimension).
  3. I'd like to be able to add dynamic coloring or shape selection based on the existence of certain meta-data.

(You may notice a meta-data theme there :) .)

Does that seem like something that would be of interest to you?

ankitrohatgi commented 5 years ago

Hi Bill, I understand the need for these features, but unfortunately this is going to be out of scope for the time being.

billdenney commented 5 years ago

@ankitrohatgi, would a PR giving some hooks for plugins (allowing these or other features, but keeping the features themselves outside of WebPlotDigitizer) be considered?

billdenney commented 5 years ago

As I'm thinking about this more, I think that the general interface would be to allow embedding WPD within another application. Specific areas that I can think of for embedding would be:

  1. Load a file from an API call instead of from the file menu.
    1. This would probably include the ability to load a file from a URL instead of upload.
  2. Load the JSON saved object from an API call.
    1. This would probably include the ability to load a file from a URL instead of upload.
  3. Export the JSON saved object from an API call.
    1. This paired with the ability to load the JSON object would enable very general modification outside of WPD.
  4. Make a notifier that can be attached to for a new axis, a new dataset, or a new data point.
  5. Add API calls to create new axes, datasets, and data points.
  6. Make an "add metadata" API call that would place metadata about an object (file, axis, dataset, or point) with the object.
  7. Make a "get metadata" API call that would extract the metadata for an identified object (ref #171) and send it back.
  8. Enable turning on and off parts of the user interface.
    1. The parts that I'm thinking are that: If loading and saving the JSON were done from the API calls, we may want to be able to disable file and JSON loading (simple CSS of "display: none"). Similarly, dataset export may be better removed in that situation.

Can you think of more interfaces that would be useful to enable embedding?

ankitrohatgi commented 5 years ago

Yeah, this is quite an extensive amount for work. This is not going to happen anytime soon.

billdenney commented 3 years ago

I think that #242 will close this.

billdenney commented 2 years ago

This can be considered complete with the addition of #242.