How to use @xviz/builder - 10 common examples

To help you get started, we’ve selected a few @xviz/builder 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 uber / xviz / test / modules / builder / builders / xviz-builder.spec.js View on Github external
test('XVIZBuilder#default-ctor', t => {
  /* eslint-disable no-unused-vars */
  const builder = new XVIZBuilder({});
  t.end();
  /* eslint-enable no-unused-vars */
});
github uber / xviz / test / modules / builder / builders / xviz-builder.spec.js View on Github external
test('XVIZBuilder#futures-multiple-primitive reverse timestamp insert', t => {
  const builder = new XVIZBuilder();
  setupPose(builder);
  const streamId = '/test/polygon';

  const verts1 = [[1, 2, 3], [0, 0, 0], [2, 3, 4]];
  const verts2 = [[0, 0, 0], [4, 0, 0], [4, 3, 0]];

  // NOTE: inserted in reverse timestamp order
  const ts1 = 2.0;
  const ts2 = 1.0;

  builder
    .futureInstance(streamId, ts1)
    .polygon(verts1)
    .style({
      fill_color: [255, 0, 0]
    });
github uber / xviz / test / modules / builder / writers / xviz-writer.spec.js View on Github external
test('XVIZWriter#default-ctor sink', t => {
  /* eslint-disable no-unused-vars */
  const builder = new XVIZWriter({dataSink: new MemorySink()});
  t.end();
  /* eslint-enable no-unused-vars */
});
github uber / xviz / test / modules / builder / builders / xviz-time-series-builder.spec.js View on Github external
test('XVIZTimeSeriesBuilder#default-ctor', t => {
  /* eslint-disable no-unused-vars */
  const builder = new XVIZTimeSeriesBuilder({});
  t.end();
  /* eslint-enable no-unused-vars */
});
github uber / xviz / test / modules / builder / builders / xviz-ui-primitive-builder.spec.js View on Github external
test('XVIZUIPrimitiveBuilder#default-ctor', t => {
  /* eslint-disable no-unused-vars */
  const builder = new XVIZUIPrimitiveBuilder({});
  t.end();
  /* eslint-enable no-unused-vars */
});
github uber / xviz / test / modules / builder / builders / xviz-variable-builder.spec.js View on Github external
test('XVIZVariableBuilder#default-ctor', t => {
  /* eslint-disable no-unused-vars */
  const builder = new XVIZVariableBuilder({});
  t.end();
  /* eslint-enable no-unused-vars */
});
github uber / xviz / test / modules / builder / builders / xviz-ui-primitive-builder.spec.js View on Github external
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/* eslint-disable camelcase */
import test from 'tape-catch';
import XVIZUIPrimitiveBuilder from '@xviz/builder/builders/xviz-ui-primitive-builder';
import {default as XVIZBuilderValidator} from '@xviz/builder/builders/xviz-validator';
// import {XVIZValidator} from '@xviz/schema';

// const schemaValidator = new XVIZValidator();

const validator = new XVIZBuilderValidator({
  validateWarn: msg => {
    throw new Error(msg);
  },
  validateError: msg => {
    throw new Error(msg);
  }
});

const TEST_COLUMNS = [{display_text: 'Name', type: 'string'}];

test('XVIZUIPrimitiveBuilder#default-ctor', t => {
  /* eslint-disable no-unused-vars */
  const builder = new XVIZUIPrimitiveBuilder({});
  t.end();
  /* eslint-enable no-unused-vars */
});
github uber / xviz / test / modules / builder / builders / xviz-time-series-builder.spec.js View on Github external
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/* eslint-disable camelcase */
import test from 'tape-catch';
import XVIZTimeSeriesBuilder from '@xviz/builder/builders/xviz-time-series-builder';
import {default as XVIZBuilderValidator} from '@xviz/builder/builders/xviz-validator';
import {XVIZValidator} from '@xviz/schema';

const schemaValidator = new XVIZValidator();

const validator = new XVIZBuilderValidator({
  validateWarn: msg => {
    throw new Error(msg);
  },
  validateError: msg => {
    throw new Error(msg);
  }
});

test('XVIZTimeSeriesBuilder#default-ctor', t => {
  /* eslint-disable no-unused-vars */
  const builder = new XVIZTimeSeriesBuilder({});
  t.end();
  /* eslint-enable no-unused-vars */
});

test('XVIZTimeSeriesBuilder#null getData', t => {
github uber / xviz / test / modules / builder / builders / xviz-variable-builder.spec.js View on Github external
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/* eslint-disable camelcase */
import test from 'tape-catch';
import XVIZVariableBuilder from '@xviz/builder/builders/xviz-variable-builder';
import {default as XVIZBuilderValidator} from '@xviz/builder/builders/xviz-validator';
import {XVIZValidator} from '@xviz/schema';

const schemaValidator = new XVIZValidator();

const validator = new XVIZBuilderValidator({
  validateWarn: msg => {
    throw new Error(msg);
  },
  validateError: msg => {
    throw new Error(msg);
  }
});

test('XVIZVariableBuilder#default-ctor', t => {
  /* eslint-disable no-unused-vars */
  const builder = new XVIZVariableBuilder({});
  t.end();
  /* eslint-enable no-unused-vars */
});

test('XVIZVariableBuilder#null getData', t => {
github uber / xviz / test / modules / builder / xviz-loader / xviz-encode-parse.spec.js View on Github external
state_updates: [
      {
        timestamps: 1317042272459,
        primitives: {}
      }
    ]
  };

  const xvizBinary = encodeBinaryXVIZ(sample_lidar, options);
  const xvizBinaryDecoded = parseBinaryXVIZ(xvizBinary);

  validateLidarData(t, xvizBinaryDecoded);

  frame.state_updates[0].primitives.lidarPoints = xvizBinaryDecoded;

  const frameBinary = encodeBinaryXVIZ(frame, options);
  // TODO/ib - might be interesting to check why this has increased.
  // Should make effort to keep overhead small in loaders.gl
  t.equal(frameBinary.byteLength, 584);

  const xvizBinaryDecoded2 = parseBinaryXVIZ(frameBinary);
  const lidar = xvizBinaryDecoded2.state_updates[0].primitives.lidarPoints;
  validateLidarData(t, xvizBinaryDecoded);

  t.end();
});