MCPcopy Index your code
hub / github.com/aurelia/ui-virtualization

github.com/aurelia/ui-virtualization @0.5.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.5.2 ↗ · + Follow
198 symbols 431 edges 22 files 2 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

aurelia-ui-virtualization

npm Version ZenHub Join the chat at https://gitter.im/aurelia/discuss CircleCI

This library is part of the Aurelia platform and contains a plugin that provides a virtualized repeater and other virtualization services. This plugin enables "virtualization" of list through a new virtual-repeat.for. When used, the list "virtually" as tens or hundreds of thousands of rows, but the DOM only actually has rows for what is visible. It could be only tens of items. This allows rendering of massive lists of data with amazing performance. It works like repeat.for, it just creates a scrolling area and manages the list using UI virtualization techniques.

To keep up to date on Aurelia, please visit and subscribe to the official blog and our email list. We also invite you to follow us on twitter. If you have questions, please join our community on Gitter. If you would like to have deeper insight into our development process, please install the ZenHub Chrome or Firefox Extension and visit any of our repository's boards. You can get an overview of all Aurelia work by visiting the framework board.

Installation

Install via JSPM

jspm install aurelia-ui-virtualization

Load the plugin

export function configure(aurelia) {
  aurelia.use
    .standardConfiguration()
    .developmentLogging()
    .plugin('aurelia-ui-virtualization'); // Add this line to load the plugin

  aurelia.start().then(a => a.setRoot());
}

Use the plugin

Simply bind an array to virtual-repeat like you would with the standard repeat. The repeated rows need to have equal height throughout the list, and one items per row.

div

<template>



    ${$index} ${item}



</template>

unordered list

<template>
  <ul>
    <li virtual-repeat.for="item of items">
    ${$index} ${item}
    </li>
  </ul>
</template>

table

<template>
  <table>
    <tr virtual-repeat.for="item of items">
      <td>${$index}</td>
      <td>${item}</td>
    </tr>
  </table>
</template>
export class MyVirtualList {
    items = ['Foo', 'Bar', 'Baz'];
}

With a surrounding fixed height container with overflow scroll. Note that overflow: scroll styling needs to be inline on the elemenet.

<template>






      ${$index} ${item}






</template>

If you are running the plugin in the skeleton-naviagion project, make sure to remove overflow-x: hidden; and overflow-y: auto; from .page-host in styles.css.

Demo

Platform Support

This library can be used in the browser only.

Building The Code

To build the code, follow these steps.

  1. Ensure that NodeJS is installed. This provides the platform on which the build tooling runs.
  2. From the project folder, execute the following command:

shell npm install 3. Ensure that Gulp is installed. If you need to install it, use the following command:

shell npm install -g gulp 4. To build the code, you can now run:

shell gulp build 5. You will find the compiled code in the dist folder, available in three module formats: AMD, CommonJS and ES6.

  1. See gulpfile.js for other tasks related to generating the docs and linting.

Running The Tests

To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps:

  1. Ensure that the Karma CLI is installed. If you need to install it, use the following command:

shell npm install -g karma-cli 2. Ensure that jspm is installed. If you need to install it, use the following commnand:

shell npm install -g jspm 3. Install the client-side dependencies with jspm:

shell jspm install

  1. You can now run the tests with this command:

shell karma start

Extension points exported contracts — how you extend this code

ViewStrategy (Interface)
(no doc)
src/view-strategy.js

Core symbols most depended-on inside this repo

call
called by 100
src/virtual-repeat.js
d
called by 39
sample/system.js
t
called by 25
sample/system.js
n
called by 18
sample/system.js
a
called by 13
sample/system.js
c
called by 13
sample/system.js
createItem
called by 11
sample/src/phone-list.js
viewCount
called by 11
src/virtual-repeat.js

Shape

Method 119
Function 42
Class 36
Interface 1

Languages

TypeScript100%

Modules by API surface

test/mocks.js36 symbols
src/virtual-repeat.js34 symbols
src/view-strategy.js32 symbols
sample/system.js24 symbols
sample/src/phone-list.js17 symbols
src/array-virtual-repeat-strategy.js15 symbols
test/virtual-repeat-integration.spec.js8 symbols
test/component-tester.js8 symbols
src/utilities.js7 symbols
src/dom-helper.js4 symbols
test/noop-value-converter.js3 symbols
src/virtual-repeat-strategy-locator.js3 symbols

For agents

$ claude mcp add ui-virtualization \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact