How to use the react-mosaic-component/lib/util/mosaicUpdates.updateTree function in react-mosaic-component

To help you get started, we’ve selected a few react-mosaic-component examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ProjectMirador / mirador / src / lib / MosaicLayout.js View on Github external
first = addedWindowIds[i];
        second = destination;
      }
      const update = {
        path,
        spec: {
          $set: {
            direction,
            first,
            second,
          },
        },
      };
      // We cannot batch the updates together because we need to recalculate
      // the new location for each new window
      this.layout = updateTree(this.layout, [update]);
    });
  }
github ProjectMirador / mirador / src / lib / MosaicLayout.js View on Github external
removeWindows(removedWindowIds, windowPaths) {
    const removeUpdates = removedWindowIds
      .map(windowId => (
        createRemoveUpdate(this.layout, windowPaths[windowId])
      ));
    this.layout = updateTree(this.layout, removeUpdates);
  }
}