Skip to content

Instantly share code, notes, and snippets.

@troygibb
troygibb / mosaic-tab-panel-implementation.md
Last active March 31, 2021 02:47
Description of how we created tabs with react-mosaic

Motivation

Our product, Webviz, often finds itself short of real estate when users attempt to use an increasing number of panels. We also run into performance constraints when rendering so many panels, so we decided to implement tabbed panels to reduce both the visual and compute headaches!

Check out our release PR here to see the feature!

Challenges

The tiling library we rely on, react-mosaic, does not support tabs out of the box, but it does allow nested layouts! So we created a special kind of tile that would render nested layouts, and wrote a tab-like interface on top of it.

#!/usr/bin/env python
import sys
import roslib;
import rospy
import rosbag
from rospy import rostime
import argparse
import os
# Original: