Download it Here.
Highlights:
- Easily create visually appealing charts for Indigo control pages.
- Seamlessly manage attributes like color, fonts, sizes (and more!) for all charts at once.
- Customize individual charts with markers, annotations, minimums and maximums, and user-defined constants.
- Chart types Include: Line Charts, Bar Charts, Polar Charts, Multiline Text Charts, and WUnderground Plugin Charts.
- Chart data that is created with the plugin, or incorporate your own (CSV).
- Charts update automatically.
The Matplotlib plugin is designed to make creating visually appealing charts for Indigo control pages. Many of the chart attributes, such as background color, font styles and chart size can be managed centrally--for example, you can change the background color of all your charts simultaneously. You can add additional customizations to each individual chart if you like, such as overriding the default chart size or displaying a chart legend only on selected charts. The overriding emphasis in designing the plugin is simplicity. The instructions below seem like a lot, but almost all of the settings can be left as default when you begin. It's best to read through all these instructions before getting started.
Plugin Settings:
The plugin configuration dialog is the first place that you will land when you first install the plugin. Chances are that you will be able to leave most of these settings alone when you begin. The configuration menu looks like this:
Save Data Files To: This is where the plugin will look for data to chart. The plugin can plot your CSV data or if you choose, the plugin can create CSV data files for you (more on the data in a bit). The specified folder must be visible to the server at all times.
Save Images To: This is the folder where the plugin will saye the image files that it creates. If the default folder is used, the images will be automatically available in the control page editor.
Refresh Interval: How often the plugin will generate a new version of your charts.
Resolution: The resolution of the image files (in DPI). The default is 100 and will probably work just fine for most users.
Size for Rectangular Charts, Extra Wide Rectangular Charts, and Square Charts: The default sizes for each chart. These values are in pixels. Square charts only need one value which is used for length and width.
Chart Properties: These control the look and feel of all of your charts. A note about colors. You can use the standard palette of colors or--if you enable the feature in advanced settings--you can select "Custom". if you select "Custom", a new field will appear for you to enter your custom color. These values are HTML color values (see the image above for an example) or standard color names (like Blue or Green). There is also an additional color option for the chart background and the cart canvas which allows these values to be transparent.
Debugging:
The plugin takes advantage of Indigo 7's enhanced debug logging facility:
The default for logging is "Warning" which will alert you only to issues that you may want to address. Select "Informational Messages" to see select notifications of plugin activity. The logging levels are inclusive of "higher" levels. In other words, if you set the level to Informational Messages, you'll also receive all Warnings, Errors and Critical messages.
CSV Data
Once you save your settings, the next thing that you might want to do is generate some CSV data. This is done using the plugin's built-in CSV Data Engine. To establish your CSV Engine, create a new Indigo Device, select Matplotlib as the device type and CSV Engine as the device model.
For each element, you must add three things: a title, a device number (or variable number) and a device state (or variable value). Once entered, then select "Add Item". Note that things you add here are not fully committed until you hit the save button. Use the second configuration area to modify or delete existing data elements. Again, changes will not be fully committed until you select save. Only data generated by the plugin can be managed with the CSV engine--if you add CSV data external to the plugin, you're on your own. If you choose to use the feature, you only need to create one CSV engine device. If you add additional CSV data elements, add them using the same CSV Engine device. After you add a new element, it will take some time for the CSV data to be generated. The first observation will be added the next time the plugin cycles (which is set in the plugin configuration dialog above). Each time the plugin cycles, it will generate new CSV data and then will create new charts (to ensure the most recent observations are included).
TIP: An easy way to identify the states associated with any device is to run the following code from an Indigo Script window. Replace 'DEVICE_ID' with the ID number for your specific device. Avoid using states that end in 'ui.' Variables only have one--called 'value'.
- Code: Select all
indigo.server.log(unicode(indigo.devices[DEVICE_ID].states))
If you are successful, the plugin will generate CSV files like this:
Your First Plot
Once you have some data to chart, it's time to create your first plot. Plots are built using Matplotlib Plugin Devices. Create a new device and enter the configuration dialog. Most of these settings should be self explanatory, but one or two deserve additional explanation.
Output Filename: Here, we just enter the full name of the chart--something like: chart_illumination.png. You shouldn't include a path, that is set in the main plugin configuration dialog.
Some fields require a valid value or the word 'None'--if you set the value to None, the setting will be ignored. For example, a custom width value must either be a valid value in pixels or None. A blank will cause an error. If there's a problem, the plugin will try to fix the error for you. Other things can be blank -- like a title -- because entering 'None' will generate a title 'None'!
Custom Line Segments: this information (if enabled) requires a pair of values: a value to chart and a color presented as tuples: (123.4, 'blue'), (234.5, 'green').
Advanced Settings:
There are some advanced settings which enable additional features and affect how the plugin functions:
Enable Custom Colors: the plugin is limited to standard color options until this setting is enabled.
Enable Custom Line Segments: custom line segments are not available until this setting is enabled.
Promote Custom Line Segments: if selected, the chart's Y axis will be expanded to ensure that the custom value is always visible.
Enable Snappy Menus: if selected, this will cause all expandable menus to be minimized when first opened.
Last, and certainly not least -- some charts!
Your charts will be located in the folder that you established in your plugin preferences setting. You can view them in finder, but it's much better to add them to Indigo control pages. If you opted to keep the default image saving location, you can add them to a control page easily by adding a new Static Image--your charts should be listed in the dropdown list of images. If you selected another location, you can add the image as a Refreshing Image by adding 'file:///" and then listing the full path to the image (that's three slashes at the start). It will look something like this:
file:///Library/Application Support/Perceptive Automation/Indigo 7/IndigoWebServer/images/controls/static/filename.png
Some Tips:
- Leave the settings at default whenever possible as you begin.
- It's helpful to have some data to chart.
- When naming your charts, it's helpful to give them similar names. I start everything with 'chart_' so that they will all appear together in the control page list.
- Make a small number of changes at a time to see how the changes affect your charts. A bunch of changes at once can make it difficult to figure out what went wrong (if you don't like the result).
Overall, start simple and get used to the function of the plugin. Although this seems like a lot of explanation, once you get the hang of it, the simplicity of the plugin will become apparent. Most of all, enjoy!