Skip to content

Commit

Permalink
Merge pull request #107 from nomic-ai/unmerged-2-15-changes
Browse files Browse the repository at this point in the history
Unmerged-2-15-changes
  • Loading branch information
bmschmidt authored Mar 26, 2024
2 parents a68a048 + 4a4e071 commit 901a038
Show file tree
Hide file tree
Showing 124 changed files with 1,529 additions and 1,262 deletions.
12 changes: 12 additions & 0 deletions dist/Dataset.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ export declare abstract class Dataset<T extends Tile> {
* @param filter
*/
visit(callback: (tile: T) => void, after?: boolean, filter?: (t: T) => boolean): void;
/**
* Invoke a function on all tiles in the dataset, downloading those that aren't
* here yet..
* The general architecture here is taken from the
* d3 quadtree functions. That's why, for example, it doesn't
* recurse.
* @param callback The function to invoke on each tile.
* @param after Whether to execute the visit in bottom-up order. Default false.
* @param filter
*/
visit_full(callback: (tile: T) => Promise<void>, after: boolean, starting_tile: T | null, filter: (t: T) => boolean, updateFunction: (tile: T, completed: any, total: any) => Promise<void>): Promise<void>;
schema(): Promise<Schema<any>>;
/**
*
Expand Down
2 changes: 1 addition & 1 deletion dist/Dataset.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 34 additions & 2 deletions dist/deepscatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -35997,7 +35997,7 @@ class Tile {
return 0;
}
async schema() {
this.download();
await this.download();
await this.promise;
return this._schema;
}
Expand Down Expand Up @@ -36556,6 +36556,38 @@ class Dataset {
}
}
}
/**
* Invoke a function on all tiles in the dataset, downloading those that aren't
* here yet..
* The general architecture here is taken from the
* d3 quadtree functions. That's why, for example, it doesn't
* recurse.

* @param callback The function to invoke on each tile.
* @param after Whether to execute the visit in bottom-up order. Default false.
* @param filter
*/
async visit_full(callback, after = false, starting_tile = null, filter2 = (x) => true, updateFunction) {
let seen = 0;
const start2 = starting_tile || this.root_tile;
await start2.download();
const total = JSON.parse(start2.record_batch.schema.metadata.get("total_points"));
async function resolve(tile) {
await tile.download();
if (after) {
await Promise.all(tile.children.map(resolve));
await callback(tile);
seen += tile.record_batch.numRows;
void updateFunction(tile, seen, total);
} else {
await callback(tile);
seen += tile.record_batch.numRows;
void updateFunction(tile, seen, total);
await Promise.all(tile.children.map(resolve));
}
}
await resolve(start2);
}
async schema() {
await this.ready;
if (this._schema) {
Expand Down Expand Up @@ -38669,12 +38701,12 @@ class Scatterplot {
}
}
const selection2 = new DataSelection(this, params);
await selection2.ready;
this.selection_history.push({
selection: selection2,
name: selection2.name,
flushed: false
});
await selection2.ready;
return selection2;
}
/**
Expand Down
2 changes: 1 addition & 1 deletion dist/deepscatter.umd.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/tile.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export declare abstract class Tile {
abstract codes: [number, number, number];
constructor(dataset: Dataset<Tile>);
get children(): this[];
download(): void;
download(): Promise<void>;
delete_column_if_exists(colname: string): void;
get_column(colname: string): Promise<Vector>;
private transformation_holder;
Expand Down
2 changes: 1 addition & 1 deletion dist/tile.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

Loading

0 comments on commit 901a038

Please sign in to comment.