Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@malloydata/render

Package Overview
Dependencies
Maintainers
3
Versions
1425
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@malloydata/render

The Malloy Renderer is a web component for rendering Malloy query results. It is included by default in the Malloy VSCode extension, but can also be embedded by developers into their own applications that use Malloy query results. To learn more about how

latest
Source
npmnpm
Version
0.0.315
Version published
Weekly downloads
835
-66.69%
Maintainers
3
Weekly downloads
 
Created
Source

Malloy Renderer

The Malloy Renderer is a web component for rendering Malloy query results. It is included by default in the Malloy VSCode extension, but can also be embedded by developers into their own applications that use Malloy query results. To learn more about how to use the renderer in a Malloy model, see the Renderer docs.

Using the Renderer in Web Apps

  • Install the renderer package
$ npm i @malloydata/render
  • Import the web component somewhere in your project. This will automatically register the <malloy-render> web component on your document.
import '@malloydata/render/webcomponent';
  • Use the web component in your app by creating a <malloy-render> node and passing it Malloy query results:
const malloyRenderElement = document.createElement('malloy-render');
// Pass a Malloy Result object to the renderer
malloyRenderElement.result = myMalloyResult;

/*
Alternatively, you can pass Malloy QueryResult and ModelDef objects to the renderer,
which will then construct the Result object. This is useful when you are receiving serialiazed Malloy results via an API.
*/
malloyRenderElement.queryResult = myQueryResult;
malloyRenderElement.modelDef = myModelDef;

Explicitly registering the web component

In some situations, such as using Malloy Render with a mock DOM like JSDOM, you may want to explicitly register the web component on a document. This can be done using the @malloydata/render/webcomponent/register import like so:

import registerMalloyRender from '@malloydata/malloy-render/webcomponent/register';

const {window} = new JSDOM(`...`);

registerMalloyRender({
  customElements: window.customElements,
  HTMLElement: window.HTMLElement,
});

Plugin System

The Malloy Renderer supports a plugin system for creating custom visualizations. See the plugin documentation:

Developing

See the Developing README

FAQs

Package last updated on 11 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts