I've posted a few questions here and stackexchange with mixed results. This leads me to believe that maybe I'm approaching my module incorrectly, and there's likely a better way of making this module.

I'm making a wrapper for the Javascript FLOT library. I have it done and working, but there are a few things which are not ideal. If interested, the code is here. Most of the work takes place in a twig template:

{{ attach_library('flot_d8/flot') }}

{% for plugin in plugins %}
    {{ attach_library(plugin) }}
{% endfor %}

{% if options['xaxis']['mode'] == 'categories' %}
{{ attach_library('flot_d8/categories') }}
{% endif %}

{% if options['selection'] is defined %}
{{ attach_library('flot_d8/selection') }}
{% endif %}

{% if options['pan'] is defined %}
{{ attach_library('flot_d8/navigate') }}
{% endif %}

{% if resizable == true %}
{{ attach_library('flot_d8/resize') }}
{% endif %}

{% block content %}
<div id="{{div_id}}" style="width:600px;height:300px;"></div>
{% endblock %}

The module code follows next, but is only used if an end user does not wish to extend this template:

function flot_d8_theme(array $existing, $type, $theme, $path) {
  return array(
    'flot_d8_my_template' => array(
      'variables' => array(
        'div_id' => NULL,
        'options' => array(),
        'plugins' => array(),
        'resizable' => FALSE,
      ),
    ),
  );
}

When I wish to produce a FLOT chart in another module, I'll extend this template, and add the extra formatting to the content block. As-is, the only thing I'd like to change is the fact that the modules which call this FLOT library module need to add the appropriate data to drupalSettings in order for the javascript code to work. Someone suggested that If I made this an entity instead, the entity code might be able to do this. Is it possible to create an entity which does not save anything to the database? The plots are interactive and meant to be updated in real-time, so that ~might~ not be ideal. However, registering a unique id in the database for each node that contains a graph wouldn't be too horrible.

Secondly, there are many FLOT plugins out there. I'd like to be able to easily wrap them and have a preprocessing function or something whereby a user can just install a module for a plugin, and this FLOT wrapper and the plugin wrapper can handle determining if the plugin javascript needs to be included. This is similar to what is done in the twig template in the FLOT wrapper, but I wouldn't want the end user to have to add another theme for any plugins they may or may not want to use.

Let me know if there are any ideas out there, or if there are any other projects which behave similarly that I can reference.