Interactive SVG Map Component

Overview

The possibility to highlight business KPIs with colors on tailored custom maps and to drill down into details from that is a common need in several sectors such as:

  • Retail for stores
  • Public Sector for geographical area
  • Logistic for warehouses
  • Office Space design/allocation
  • and many others

Leveraging an SVG integration, we provide a way to customer to use their own svg maps into Appian SAIL.

Key Features & Functionality

The interactiveSvgMapComponent allows customers to:

  • Provide a custom SVG map image
  • Specify a list of areas as a parameter for which a different color (standard Appian colors or hex code) can be applied, show a custom tooltip, decide the best way to highlight the area on mouse hover, and optionally allow a click event on the area itself
  • Zoom in and out on the map using the mouse, buttons, or icons
  • Pan the map within the component area
  • Use Appian document generation template format to populate a text field in the map image with Appian values
  • As a result, the component will return the index of the selected area (across the ones specified as a parameter), which can be used in SAIL to show the details data related to that area
  • By leveraging the Rich Text Editor image upload connected system, it is also possible to convert the resulting map into a PNG image document for reporting purposes or for use in SAIL interfaces for read-only users.
Anonymous
  • Things I would check

    • Are you experiencing this with just this plugin or with other Interface components as well ? 
    • Are you rendering the same map you have on your community or is it a different map ?
    • Also have you tried to inspect the page ?
  • Hello, I used this plug-in in my community appian and everything worked fine. Then I copied the interface in my company's appian and map won't appear. Everything is the same. I had an issue of this type a month ago, when I didn't see the map, but one of my colleagues did - I thought that it could be a version issue (as my company's Appian used the previous version of plug-in), but now neither of us sees the map. (Currently we have the latest version of plug-in)

  • Thank you Lorenzo for helping us.

    We had everything right, I just hadn't found the readtextfromfile function (probably because the plugin is a bit old).

    Congratulations on the great Plug-in you've developed, grazie!

  • You are passing the document as parameter while you should pass the svg as string as per doc mapSvg (Text): SVG Map Source

    In your case you can use readtextfromfile(local!svg) , requires Text File Utilities plugin, in your code to get that

    Also be aware that to be shown SVG file should start with <svg> tag (no xml/html headers tag)

    refers to the word document with all parameters and note in the download package

  • This is the second image, not sure if you can see it.

  • Thank you for your reply.

    I took another look at the sample app, but from what I can see all the SVGs that are used there are inside constants.

    Let me show you an example:

    As you can see, the SVG is not visible with your component. Are we doing something wrong?

  • Hi Chiara , yes the component can also display svg document without interacting with it , you can download the sample app in this page for directions and code

  • Hello Lorenzo, I wonder if you can help us with a problem.

    We receive an SVG from a webservice and we save the whole SVG tag from the XML to an Appian document.

    We found that the only way to view this SVG document is using the documentViewerField, but we would love to use your custom component (which we are already using elsewhere).

    Can you advise us if there is any way to view this SVG Appian Document with your component?

    Thank you

  • v4.0 Release Notes
    • New Zoom In and out into SVG Map thru gesture/mouse wheel/component built-in controls
    • New Pan feature to move the map within component area allowing to focus on specific area
    • New Options to enable/disable Pan and Zoom features
    • New Option to show/hide zoom controls and to specify their position and color when shown
  • Thanks Antonio for your spot , I think  I understood where your issue is

    by design  mapAreaParameters is a JSON list of parameters (as per  help in designer) but in your code it is  single dictionary object.

    Lines from 12 to 16 may be modified as follow

    mapAreaParameters: a!tojson(
          {
            {
              id: "circlex",
              caption: "caption test",
              color: "ACCENT",
    
            }
         }
    ),

    Note that even you are having only one parameter  you need to to pass  a list of dictionary to a!toJson to get the json list of parameters..

    We may consider in future version to remove the need of forcing a list when there is just one parameter but if you stick to above your SVG sample should work properly