website logo
👥 Community🎯 Samples on GitHub🚦System Status
💡 Guides
🚀 Examples
🍕 Developer Reference
⚡️ Changelog
🎥 Video Library
Navigate through spaces
⌘K
Examples Overview
Setting up your solution
Jig Types
Components
Datasource
Actions
Preview
Widgets
Expressions
Aggregation
Boolean
Comparison Operators
Date & Time
Path Operators
Functional Programming
Jigx Variables
Predicate Queries
String
Docs powered by
Archbee
Components
interactive-image

interactive-image-item

6min

In the section, a brief introduction was provided to interactive images.

We know that an interactive image is an image with clickable links that can be used to convey information visually instead of via text.

The interactive-image-item can be set in various ways:

  1. You can use x and y coordinates and determine various points on the image
  2. You can specify different groups and determine the points that should be grouped together
  3. You can personalize the points by specifying icons or colors
  4. You can determine whether a specific point is active or inactive

Configuration options

Some properties are common to all components, see Common component properties for a list and their configuration options.



The core structure includes: id, title, and percentageCoordinates(x and y coordinates)

Other option:

color and icon - This allows you to set a specific color and icon for different states (e.g. when the point is selected)

style - There are styling sets:

  • isActive
  • isDisabled

groupId - This property allows you to add the item to the group (the groups are created inside the interactive-image component)

Actions:

onPress - The possibility to add any of the actions (please refer to the list of our Actions). This action(s) will be triggered as a reaction to the press event.

Examples and code snippets 

Restaurant table booking example

Document image

Document image


The example indicates how this can indicate tables within a restaurant that are available for booking.

Examples: See the full example using static data in GitHub. See the full example using dynamic data in GitHub.

Datasource: See the full datasource for static data in GitHub. See the full datasource for dynamic data in GitHub.

interactive-image-rest (static)
interactive-image-rest (dynamic)
datasources (static)
datasources (dynamic)
|
children:
  - type: component.interactive-image
    options:
      imageHeight: 1500
      source: 
        uri:  https://fpg.roomsketcher.com/image/level/164/3d/Elegant-Restaurant-Plan-3D.jpg

          
      data: =@ctx.datasources.floorplan-restaurant-static
      pointColor: color10
      groups:
        - title: Reserved Tables
          id: Reserved
          color: color14

      item:
        type: component.interactive-image-item
        options:
          id: =@ctx.current.item.id
          title: =@ctx.current.item.name
          icon: =@ctx.current.item.isReserved = true ? 'close' :null
          color: =@ctx.current.item.isReserved = true ? 'color3' :null
          style:
            isDisabled: =@ctx.current.item.isReserved = true ? true :false
          
          percentageCoordinates:
            x: =@ctx.current.item.xCoordinate
            y: =@ctx.current.item.yCoordinate


Hot seat and meeting room booking example

Document image

Document image


The example indicates how this can be used to indicate hot seats and meeting rooms at an office that can be booked.

Examples:

See the full example using static data in GitHub.

interactive-image (static)
datasources (static)
|
children:
  - type: component.interactive-image
    options:
      imageHeight: 1500
      source: 
        uri:  https://i.pinimg.com/564x/b0/eb/52/b0eb52122452257e955f210e7fdb8f55.jpg

          
      data: =@ctx.datasources.interactive-image-office
      pointColor: color10
      groups:
        - title: Selected desks
          id: Selected desks
          color: color2
        - title: Hot desk - reserved
          id: Hot desk - reserved
          color: color14
          maximumPoints: 3
        - title: Meeting room - reserved
          id: Meeting room
          color: color14
          maximumPoints: 1

      item:
        type: component.interactive-image-item
        options:
          id: =@ctx.current.item.id
          title: =@ctx.current.item.name
          icon: =@ctx.current.item.isReserved = true ? 'close' :null
          color: =@ctx.current.item.isReserved = true ? 'color3' :null
          groupId: =@ctx.current.item.group
          style:
            isDisabled: =@ctx.current.item.isReserved = true ? true :false
          
          percentageCoordinates:
            x: =@ctx.current.item.xCoordinate
            y: =@ctx.current.item.yCoordinate


See also

  • Developer reference
  • Related examples (Github)



Updated 19 Sep 2023
Did this page help you?
PREVIOUS
interactive-image
NEXT
list
Docs powered by
Archbee
TABLE OF CONTENTS
Configuration options
Examples and code snippets
Restaurant table booking example
Hot seat and meeting room booking example
See also
Docs powered by
Archbee
Copyright © 2023 Jigx, Inc. All rights reserved. Terms of Service