Pan Zoom Container

BIJC is pleased to announce its latest module, a Pan Zoom container for Perspective. There have been a number of outstanding examples of Pan Zoom using an XY container but these are very specific and generally require advanced scripting and CSS skills.

BIJC container simplifies this process and allows the XY container to be responsive.

In its simplest deployment, a developed XY container can be placed inside BIJCs Pan Zoom container and it will automatically fit to any screen size. If the developer requires, panning and zooming can be enabled/disabled independently.

Multiple views or components can be placed inside the container and the scale property can be used to change the views path or any other bindable property. Any view or component that is outside of the current viewport is not rendered and therefore the bindings are not evaluated, this is especially important for larger deployments to reduce the load on the server.

You can download the module from here where you can also find the documentation

We have created a video showing a simplistic set of views and how easy it is to use the new container.

YouTube Link

16 Likes

The fit to component feature is very cool.
Great work!

2 Likes

Hi @Chris_Taylor, I downloaded a trial version of this module and installed it in a VM, but when I launch the session, I get the dreaded Component Error - I'm using v8.1.34 or so and I don't see any issues in the logs.

Any thoughts?

EDIT: Some snips of console log:

That's strange, looks like one of our debug defaults is not being read, standby for a fix.

There is a new version due any day now, with improvements for the licencing function and making it more Maker friendly.

2 Likes

Sweet, I'll watch for that! I would like to use this module for Pan/Zoom functionality for a customer - if we can get this resolved, that would be awesome!

FYI, Latest module is released, V1.1.3
Improvements include:
Module defaults to licensed and only displays unlicenced if the licence checks fail, removing the annoying unlicenced display on slower connections
There also a few minor improvements to our debug system.

File it can be downloaded via https://modules.bijc.co.uk/

6 Likes

Hi Chris,

Not sure if this is the right place to comment on this, but I've been using the zoomPanContainer in what you described as the most simplistic way. I have a view that I put in there (using an Embedded View as the only component, the zoomPanContainer is the root container) and this works like a charm. There's an issue I'm running into I can't seem to figure out though.

My buttons inside the Embedded view are clickable. Components that have an OnDoubleClick-script running to navigate to a different page are also working as intended. But the one textbox I have just doesn't seem to be focussable. I've checked if there are other layers in the way and I've checked if the textbox is set-up correctly, that's when noticed that opening the (embedded) view directly at the source in designer and use the live-view functionality, everything works. Opening that same view in the zoomPanContainer, that's when it starts breaking.

To me this appears to be a bug in the module, but I'm happy to be proven wrong!

Kind Regards,

Morning

We can take a look

It would help if you could email an export of your view to module.support@bijc.co.uk

2 Likes

Latest version released. V1.1.4

Documents and download Zoom Pan Container - BIJC Module Support

new feature
alwaysDrawAllChildren Whether to draw children component even when they are not visible

bug fix, click to focus on text boxes corrected.

5 Likes

Hey @Chris_Taylor, is there any way to limit panning to a specific axis? We're looking at using your module to give operators access to P&IDs on mobile devices and this module seems perfect. However I'd like to (possibly) disable zoom and only allow panning horizontally to keep the interface simpler to navigate around in.

Also, is it possible to provide panning bounds, as I noticed that I can pan well beyond the bounds of the display and can get lost in the abyss.

I've tried to write to the props.currentState.posX prop but it seems this is read-only. I just saw the doco has methods available, my bad! setPosition with the onPositionChanged event provides a kinda solution, but you can still keep trying to pan the page beyond the bounds and every few hundred-ish ms you can bring it back to the bounded value. It'd be nice if you could hard-limit the bounds

A few bugs found:

  • when using setPosition the currentState props aren't updated
  • props.minScale isn't honoured when config.fitOnMount is true - it initially loads much smaller than the min (in my testing). Once you use the mouse to zoom in it jumps to the minScale setting
  • I've found a bug where panning sometimes clips the right side of the embedded content, and sometimes clips the entire content and you don't seem to be able to get it back, see video. It could be the settings I've applied? I've attached the view json defintion below as well in case. I can only seem to get it to do this if it's set to fitToMount: true
View Definition
{
  "custom": {},
  "params": {},
  "props": {},
  "root": {
    "children": [
      {
        "meta": {
          "name": "Label"
        },
        "propConfig": {
          "props.text": {
            "binding": {
              "config": {
                "expression": "{../root.props.currentState}"
              },
              "type": "expr"
            }
          }
        },
        "props": {
          "style": {
            "fontSize": "16pt"
          }
        },
        "type": "ia.display.label"
      },
      {
        "children": [
          {
            "meta": {
              "name": "Operational Digram"
            },
            "position": {
              "height": 960,
              "width": 1920
            },
            "props": {
              "path": "Pages/Station A/Operational Digram"
            },
            "type": "ia.display.view"
          }
        ],
        "events": {
          "component": {
            "onDoubleTap": {
              "config": {
                "script": "\tself.setPosition(0,0)"
              },
              "scope": "G",
              "type": "script"
            },
            "onPositionChanged": {
              "config": {
                "script": "#\txLimit \u003d -500\n#\tx \u003d None\n#\t\n#\tif event.newX \u003c xLimit:\n#\t\tx \u003d xLimit\n#\t\n#\tif event.newY !\u003d 0:\n#\t\ty \u003d 0\n#\t\tx \u003d x or event.newX\n#\t\n#\tif x:\n#\t\tself.setPosition(x,y)"
              },
              "scope": "G",
              "type": "script"
            }
          }
        },
        "meta": {
          "name": "root",
          "tooltip": {
            "enabled": true,
            "text": null
          }
        },
        "position": {
          "grow": 1
        },
        "props": {
          "config": {
            "fitOnMount": true,
            "fitOnMountInstantly": true
          },
          "currentState": {
            "posX": 375,
            "posY": -111.2734375,
            "scale": 0.777453125
          },
          "dimensions": {
            "innerHeight": 960,
            "innerWidth": 1920
          },
          "minScale": 0.5
        },
        "type": "bijc.container.zoompan"
      }
    ],
    "meta": {
      "name": "root"
    },
    "props": {
      "direction": "column"
    },
    "type": "ia.container.flex"
  }
}

I don't really understand what the props.dimensions is for. It seems to be able to clip the components within the pan/zoom container, but I don't quite understand why this wouldn't always be set to the size of the components

1 Like

Hi Nick

I like the idea of pan only in one axis. let us take a look and see what we find.

2 Likes

Hello, developer of the module here.

  1. Locking panning to an axis is something that can be added.
  2. Adding bounds to the panning is something I can look into.
  3. The bugs have been added to my task list and I'll work on those when making the above changes. Thank you for pointing them out
  4. The dimensions are the size in pixels of the inner container that holds all of the components that is scaled and moved inside the outer container. Functionally it is basically an XY container without overflow so any components falling outside of it will be clipped.

I cannot be sure on any timelines for this but I should be able to roll out something within the next few weeks.

9 Likes

Testing this on an actual mobile device now and have some other questions:

  • is it possible to add intertia to panning? It feels a bit clunky at the moment as panning just stops immediately after swiping
  • panning also feels a bit jittery on the phone like the FPS is lower than on desktop
1 Like