Skip to main content

OntoBDC View

License: Apache 2.0

ontobdc-view is the distributable browser presentation package for OntoBDC-generated views.

It ships Web Components and other browser assets as Python package data so the OntoBDC CLI can resolve them locally and embed them into standalone offline HTML artifacts.

Install

pip install ontobdc-view

Python API

from ontobdc_view import component_path, read_component

path = component_path("onto-theme-tile.js")
source = read_component("onto-theme-tile.js")

read_component() is intended for generators that need to inline the JavaScript into a final HTML artifact.

Integrated Presentation Surface preview

This preview builds and opens a complete onto-presentation-surface containing all current demonstration Tiles at the same time:

  • Logo
  • Theme
  • Language
  • Photo

Light:

python test/surface_preview.py --preview light

Dark:

python test/surface_preview.py --preview dark

The Surface computes its own grid from the available browser width. Resize the browser window to force a new allocation. The Logo and Photo Tiles receive their allocated columns and rows from the Surface and adapt their representation. Theme and Language remain 1x1. Presentation events are printed in the browser console and the latest event is shown in the system log at the bottom of the page.

Component preview

The development preview script builds the selected component, generates a temporary standalone HTML file and opens it in the default browser.

General form:

python test/preview.py <component-path> --preview light|dark --columns N --rows N

Theme Tile

Light preview:

python test/preview.py src/ontobdc_view/assets/components/onto-theme-tile.js --preview light

Dark preview:

python test/preview.py src/ontobdc_view/assets/components/onto-theme-tile.js --preview dark

Language Tile

python test/preview.py src/ontobdc_view/assets/components/onto-language-tile.js --preview light
python test/preview.py src/ontobdc_view/assets/components/onto-language-tile.js --preview dark

Logo Tile

Mark only (1x1):

python test/preview.py src/ontobdc_view/assets/components/onto-logo-tile.js --preview light --columns 1 --rows 1

Logotype (3x1):

python test/preview.py src/ontobdc_view/assets/components/onto-logo-tile.js --preview light --columns 3 --rows 1

Logotype and slogan (3x2):

python test/preview.py src/ontobdc_view/assets/components/onto-logo-tile.js --preview dark --columns 3 --rows 2

Photo Tile

Image only (1x1):

python test/preview.py src/ontobdc_view/assets/components/onto-photo-tile.js --preview light --columns 1 --rows 1

Image with additional presentation space (2x2):

python test/preview.py src/ontobdc_view/assets/components/onto-photo-tile.js --preview light --columns 2 --rows 2

Large photo representation with caption and metadata (2x3):

python test/preview.py src/ontobdc_view/assets/components/onto-photo-tile.js --preview dark --columns 2 --rows 3

The --preview option controls the host surface only: light opens the component over a white surface and dark over a black surface. --columns and --rows emulate the logical area allocated to the Tile by a Presentation Surface.

Browser usage during development

<script type="module" src="./onto-theme-tile.js"></script>

<onto-theme-tile style="width:72px;height:72px"></onto-theme-tile>

The component uses a closed Shadow DOM and emits a composed theme-changed event:

document.addEventListener("theme-changed", event => {
  console.log(event.detail.theme);
});

Packaging model

The Python package is only the distribution mechanism. The browser assets remain plain JavaScript/Web Components.

Expected OntoBDC flow:

pip install ontobdc-view
        ↓
OntoBDC resolves installed assets
        ↓
OntoBDC reads the required component source
        ↓
OntoBDC embeds it in generated HTML
        ↓
standalone/offline artifact

ontobdc-view has its own version and release cycle, independent from the OntoBDC core runtime.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ontobdc_view-0.2.0.tar.gz (52.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ontobdc_view-0.2.0-py3-none-any.whl (72.0 kB view details)

Uploaded Python 3

File details

Details for the file ontobdc_view-0.2.0.tar.gz.

File metadata

  • Download URL: ontobdc_view-0.2.0.tar.gz
  • Upload date:
  • Size: 52.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.2

File hashes

Hashes for ontobdc_view-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4560b2d8e4526488036fed613fa0af76d352c23fe835dddb14dcee7528a7e6c3
MD5 e586e356505862adb48afd5d52c63460
BLAKE2b-256 5a2168c3091e7c555ce7c9ac8996a317365182a0ad5924de86d726727a22d47b

See more details on using hashes here.

File details

Details for the file ontobdc_view-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ontobdc_view-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 72.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.2

File hashes

Hashes for ontobdc_view-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2d93f8fb7b0f317806e9054df51eac8104a0c549f1cada9aff8963e37e96b9b
MD5 3f65f085ba9aee5bbbdb9d61122f634b
BLAKE2b-256 34f8383f9c76e8eeb7d727b5099351f190debd3cc73ca07d5b3e7fdd36c7a3df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page