Skip to content

PerspectiveWidget export to html via Python #2528

Answered by texodus
ccarli asked this question in Q&A
Discussion options

You must be logged in to vote

We have plans to add this, in the meantime this logic is easy to replicate ad-hoc, it is just a simple string template - in Python it would look something like this:

def to_html(view, version="2.7.1", layout="{}"):
    import base64
    arrow = view.to_arrow()
    html = """
<!DOCTYPE html lang=\"en\">
<html>
<head>
<meta name=\"viewport\" content=\"width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no\"/>
<link rel=\"stylesheet\" crossorigin=\"anonymous\" href=\"https://cdn.jsdelivr.net/npm/@finos/perspective-viewer@{0}/dist/css/themes.css\"/>
<script type=\"module\">
import perspective from \"https://cdn.jsdelivr.net/npm/@finos/perspective@{0}/dist/cdn/pers…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ccarli
Comment options

Answer selected by ccarli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants