Axure Interactive Redline Tool
This plugin intends to mimic some of the functionality of the plugin Measure for Sketch or InVision Inspect. This application is meant for those who rely on Axure in their organizations and would like to provide developers with always-up-to-date design specifications. As Axure does not support plugins within the application itself, this code resides within and is applied to your AxShare projects.
To apply this code to one of your AxShare hosted projects, navigate to www.share.axure.com and log into your account. Once logged in, you will see an inline gear icon to the far right of each Axure project. Hovering over this icon provides a list of options, including PLUGINS which you should select. Once on the plugin page, select NEW PLUGIN. Name your plugin whatever you deem appropriate and select End of the Head as the insertion location. Paste your plugin.min.htm code into the content area and save the plugin. Select all desired pages within which you'd like to have the interactive redline tool. If you would like to have the plugin appended to any new pages, you may select Add to new pages by default. Once saved, your plugin should be activated. To modify the plugin, simply select edit and paste in any replacement code.
Installation / Running
Update npm to the latest version:
$ npm install npm@latest -g
To launch a demo instance of the plugin in your browser, issue the following commands:
$ cd axure-redline-tool$ npm install$ gulp develop
Prerequisites / Dependencies
This project was built and tested on jQuery 3.2 and Axure RP.
Building Modified Plugin
If you've made changes and would like to build an updated version of the plugin, run the following commands to generate
plugin.js. Copy the contents of
plugin.txt into your AxShare project as shown above.
If you would like to modify the plugin, two build scripts are available to aid in this.
To quickly build your changes for production issue the following commands:
$ cd axure-redline-tool$ npm install$ gulp build-prod
Because this is a compiled plugin i.e. HTML, CSS, and JS are merged into one file, you can also keep the plugin continuously watching for source changes. This will then automatically rebuild the plugin.txt file and you may then copy the plugin code directly into AxShare. This will not open an instance of the plugin in your browser. For this, issue the following commands:
$ cd axure-redline-tool$ npm install$ gulp build-watch
Bugs / Drawbacks
As this code is embedded within Axure projects, it does not have direct control of how assets are exported from within Axure. Additionally, Axure projects allow much more functionality and interactivity than those generated in Sketch and it's difficult to intercept and interact with these. The code makes every attempt to handle the various nested elements exported from Axure, but if you do encounter an issue, please let me know and I'll promptly resolve it.
You may find the generated artboard sizing odd during initial use. This tool scans all page elements and sizes the artboard based on the most-extreme elements. If you would like a specific size artboard, I would suggest using a background rectangle within Axure to define this. Alternatively, you may use a combination of vertical and horizontal lines to define your artboard border. For example, if you would like an artboard of 1000px x 1000px, place a rectangle as the backmost element in your Axure project with a X and Y location of 0 and dimensions of 1000px x 1000px.
*Axure chooses to export some common elements such as circles and lines as images instead of using CSS. As such, you may find it difficult to find accurate dimensions on some items. A workaround for circles is to place a square in Axure and set the border radius greater than or equal to 50% of the square's dimensions. This will then export as an HTML element. Axure also has difficulties in exporting elements with lots of border attributes and box shadows. It typically exports these as images and you will be unable to retrieve any CSS attributes.
- Provide Sliced Images
- Document Color Palette
We use SemVer for versioning.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details.
- Resolved the issue of overflow scrolling content affecting artboard sizing. In Axure terms, hidden dynamic panel content no longer causes the generated artboard to be bigger than visible elements.
- Resolved how the tool handles Axure annotations. Annotations can be read while the tool is disabled. While the tool is enabled, their icons are not considered interactive elements.
- Added key command functionality to support zoom controls through [Ctrl +] / [Ctrl -] and Esc key to close the redline tool panel / deselect the element.
- Added zoom tracking support to ensure current zoom level is maintained while progressing through flows.
- Revised code to handle artboard rendering issues. Axure uses images instead of CSS for many common elements such as lines and circles. These exported images often have incorrect dimensions which cause the redline tool to incorrectly size the artboard. The code has been revised accordingly to handle these scenarios.
- The tool now removes element focus when the page is scrolled. This issue caused the orange selection box to remain fixed while the element below was scrolled. Code currently closes the redline tool when scrolling occurs. Later enhancement will be to bind orange selection box to the element selected so that even with scrolling the box remains.
- Build scripts have been ported from Grunt to Gulp. Additional build options are now available, and the code injection has been improved.
- Provided color swatch preview for color and background-color attributes.
- Now support HEX and RGB(A). Color formats can be toggled by clicking color swatch.
- Provided support for repeater widgets. Updated code to ignore embedded script and style tags.
- Added box-sizing attribute to inputs to ensure correct sizing across browsers.
- Revised how inter-element dimensions are calculated. Previously, all elements were iterated, and data attributes appended. Now this is done in real-time, on only the active elements. This will help performance on pages with many elements.
- Resolved issue where the tool displays unintended hidden content.
- Resolved small CSS styling changes to improve consistency in displaying attributes.
- Resolved issue where tool throws error when disabling while an element is selected.
- Tool now provides correct artboard padding when zooming.
- Resolved measurement flicker which occurred when hovering over a measurement line or tag.
- Axure Component Names - The tool will now display any element names you've used in your project.
- Annotations Always Clickable - Annotations are always available to click, even when the tool is enabled.
- Move Redline Switch - The redline tool enable switch has been moved to the top header for better visibility.
- Show Pseudo Class Attributes - The tool now provides CSS for those pseudo classes provided by Axure.
- CDN Link - The tool can now be served from a CDN link which means faster load times and no more copying of huge blocks of code.
- Hotkey Interactions - Now it is no longer required to disable the tool to interact with Axure elements. By holding down Ctrl or ⌘ you can hover over or click on elements.
- Business / Developer Links - The tool now offers up sharing links for both business and developers. The business link will prevent the tool from even rendering itself on the page. This ensure there is no confusion when sharing your prototypes with business.
- Loading Spinner - On large pages the tool can take quite long to render the artboard. A loading spinner helps to indicate background action.
- Color Swatches - Updated code to handle color swatches for any CSS attribute containing a color.
- Parent Opacity - When adjusting opacity for the entire element in Axure, it is only applied to the parent. The tool now can accurately extract this information.
- Added CSS block properties field for easy cut and paste.
- When RGBA colors are displayed with an opacity of 1, we now convert them to RGB.
- If a CSS attribute opacity is 1, we now don't bother displaying it.
- Resolved bug in Microsoft Edge creating issues when displaying RGBA color values.
- When sharing the business link, annotations are disabled by default through the AxShare interface panel.
- Revised how sharing links are formed to accommodate private enterprise server links.
- Corrected page loading of HTML, CSS, and Google fonts. Loading of fonts was causing incorrect jQuery measurements of elements.
- Updated CSS to support RP9 artboard generation.
- Updated to support RP9 annotations.
- Ported application to React.
- Slight UI modifications.
- Grid overlay support.