Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export default async function enhance(
const outputFormat: OutputFormat | undefined = $el.data("outputFormat");
const expressionText = $el.data("expression");
const interactive = $el.data("interactive");
const archive = $el.data("archive");
const renderKey = hash({
contextName,
outputFormat,
Expand Down Expand Up @@ -232,7 +233,7 @@ export default async function enhance(
resultNormalizedInfo = {
language,
attributes: {
interactive: interactive === true,
interactive: (archive || !interactive) === false,
style: "display: inline-block",
},
};
Expand Down Expand Up @@ -317,8 +318,8 @@ function generateArrayOf$outputItems(
derivatives.contextName,
)}" data-expression="${escapeString(
outputExpression,
)}" data-interactive="${
derivatives.interactive
)}" data-interactive="${derivatives.interactive}" data-archive="${
derivatives.archive
}" data-output-format="${escapeString(
outputFormat,
)}"><code>${escapeString(outputFormat)}=${escapeString(
Expand Down
5 changes: 5 additions & 0 deletions packages/litvis/src/attributeDerivatives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export function extractAttributeDerivatives(
? normalizeExpression(attributesWithMixIns.context)
: "default",
outputFormats: [],
interactive: true,
archive: false,
outputExpressionsByFormat: {},
id: attributesWithMixIns.id,
follows: attributesWithMixIns.follows,
Expand Down Expand Up @@ -63,6 +65,9 @@ export function extractAttributeDerivatives(
isLitVis = true;
addOutputExpressions(result, "m", value);
break;
case "archive":
result.archive = !!value;
break;
case "interactive":
result.interactive = !!value;
break;
Expand Down
1 change: 1 addition & 0 deletions packages/litvis/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface AttributeDerivatives {
outputFormats: BlockOutputFormat[];
outputExpressionsByFormat: { [TKey in OutputFormat]?: string[] };
interactive?: boolean;
archive?: boolean;
id?: string;
follows?: string;
}
Expand Down