Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lets-plot in marimo: the import * problem #1126

Closed
VivaldoMendes opened this issue Jul 6, 2024 · 19 comments
Closed

lets-plot in marimo: the import * problem #1126

VivaldoMendes opened this issue Jul 6, 2024 · 19 comments

Comments

@VivaldoMendes
Copy link

Hi,

I need to use a reactive notebook in Python, so I am playing with marimo.py. I also tried producing some plots using lets-plot.

Unfortunately, when I tried the first line, marimo spells out:

import * is not allowed in marimo.

Do you have an example of how to proceed with lets-plot in order to avoid the import star problem?

Thanks

@alshan
Copy link
Collaborator

alshan commented Jul 8, 2024

To work around marimo restrictions you can:

Import the lets_plot module and then use dot-notation:

import lets_plot as pl

pl.LetsPlot.setup_html()

pl.ggplot(...
  1. import symbols manually as necessary:
from lets_plot import ggplot, aes, geom_point, ggtitle 
  1. Import all symbols from lets-plot using the importlib facility:
import lets_plot
import importlib

# Get the __all__ list from lets_plot
all_symbols = lets_plot.__all__

# Import each symbol into the current namespace
for symbol in all_symbols:
    globals()[symbol] = getattr(lets_plot, symbol)

This is equivalent to a "star" import.


However, lets-plot doesn't seem to work well in marimo notebooks out-of-the-box, according to this report: #1018.
Unfortunately, we haven't been able to take a closer look at marimo yet.

@VivaldoMendes
Copy link
Author

Thanks for your help.

I tried as you suggested and encountered a problem that I had found in a previous attempt of my own: the code blocks run without any error being spat out, but no plot is visible (or produced?). Please see the image below:

a

@JetBrains JetBrains deleted a comment from technewbie12 Jul 8, 2024
@alshan
Copy link
Collaborator

alshan commented Jul 8, 2024

You either need to have xix as the last expression in the cell or call xix.show().

@VivaldoMendes
Copy link
Author

If I close the cell with xix, the output is the same as if there were no xix: no error and no plot.

If I call xix.show(), there is no error, no plot, and the following output pops up:

{'text/html': '<html lang="en">\n   <head>\n       <meta charset="UTF-8">\n       <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.3.3/js-package/distr/lets-plot.min.js"></script>\n   </head>\n   <body>\n          <div id="0n7UpK"></div>\n   <script type="text/javascript" data-lets-plot-script="plot">\n       var plotSpec={\n"data":{\n},\n"mapping":{\n"x":"rating",\n"fill":"cond"\n},\n"data_meta":{\n},\n"ggsize":{\n"width":700.0,\n"height":300.0\n},\n"theme":{\n"flavor":"high_contrast_dark",\n"legend_background":{\n"fill":"#14181e",\n"blank":false\n},\n"panel_grid_major_x":"blank",\n"plot_background":{\n"fill":"#14181e",\n"blank":false\n}\n},\n"kind":"plot",\n"scales":[{\n"aesthetic":"fill",\n"type":"seq",\n"scale_mapper_kind":"color_brewer"\n}],\n"layers":[{\n"geom":"density",\n"mapping":{\n},\n"data_meta":{\n},\n"color":"dark_green",\n"alpha":0.7,\n"data":{\n"..density..":[0.003297454217890694,0.003512417332407343,0.0037331684490372443,0.00395922404477703,0.0041900756598468696,0.0044251980886343455,0.004664058421056729,0.004906125819516359,0.00515088189424391,0.0053978315193415425,0.005646513913898397,0.005896513797764766,0.006147472420492328,0.006399098255052908,0.006651177145617216,0.006903581701175845,0.007156279734257008,0.007409341556442306,0.007662945959662886,0.007917384734088208,0.008173065599372299,0.008430513455537924,0.008690369892179884,0.008953390929173754,0.009220442997827311,0.009492497207495435,0.009770621978157621,0.01005597415339623,0.010349788739715178,0.010653367446368377,0.010968066224085244,0.011295282020664139,0.01163643898587157,0.011992974367111825,0.012366324340758041,0.012757910021881105,0.013169123887560768,0.013601316836368331,0.014055786089469904,0.014533764117746673,0.015036408755095747,0.015564794631475466,0.016119906031143334,0.01670263125276983,0.01731375851953352,0.017953973459699533,0.018623858152246195,0.01932389170842342,0.02005445233914936,0.020815820840183998,0.02160818541221305,0.022431647721323427,0.023286230096705968,0.024171883756494456,0.025088497949046523,0.026035909895212712,0.027013915416686237,0.0280222801358234,0.02906075113283251,0.030129068946452175,0.031226979803769716,0.032354247963361955,0.03351066805330466,0.03469607728176567,0.03591036739300617,0.037153496235937916,0.03842549880635589,0.03972649761812765,0.04105671225362106,0.04241646794019882,0.04380620299843255,0.045226475009499785,0.046677965554678076,0.0481614833894717,0.049677965929093106,0.05122847894097712,0.05281421436371837,0.05443648620005712,0.056096724463805925,0.05779646719619997,0.05953735060512073,0.06132109741985685,0.0631495035932358,0.0650244235206952,0.0669477539807188,0.06892141703160454,0.0709473421244259,0.0730274477100754,0.07516362262846023,0.07735770756952248,0.0796114768883744,0.0819266210404141,0.08430472987712538,0.08674727701008855,0.08925560541056284,0.09183091436630628,0.0944742478677374,0.09718648444410423,0.09996832841910494,0.10282030250661313,0.10574274162299499,0.10873578775505273,0.11179938569378932,0.114933279425561,0.1181370089650014,0.12140990741914823,0.12475109808976426,0.1281594914506719,0.13163378187820293,0.13517244406425452,0.13877372910107622,0.14243566029244184,0.14615602881459114,0.1499323894192076,0.1537620564365777,0.15764210039662946,0.16156934563566464,0.16554036929421656,0.1695515021340009,0.17359883160716827,0.17767820759742364,0.18178525121912553,0.18591536700702513,0.1900637587564705,0.19422544918310705,0.19839530346457523,0.20256805660740262,0.20673834445390316,0.21090073801061532,0.21504978064634783,0.21918002757919625,0.22328608695303692,0.2273626616999855,0.231404591300895,0.23540689249544414,0.23936479796037716,0.2432737919719127,0.24712964209808885,0.250928426029794,0.2546665527550936,0.2583407774088055,0.26194820928539675,0.26548631268442185,0.26895290045900755,0.27234612035357275,0.275664434440441,0.2789065921891876,0.2820715979199729,0.2851586735951879,0.2881672180850949,0.2910967641958301,0.2939469348658496,0.29671740001434976,0.2994078355581419,0.3020178860990557,0.30454713272089895,0.30454713272089895,0.306995067223279,0.30936107396131823,0.3116444202585381,0.3138442561201482,0.3159596237018505,0.31798947669270206,0.3199327094581255,0.32178819547021237,0.3235548342367348,0.3252316056378299,0.3268176302997498,0.32831223438776946,0.32971501699362044,0.33102591813404375,0.3322452852721498,0.3333739362266136,0.33441321634794285,0.33536504791691096,0.3362319698566909,0.33701716604424065,0.33772448075339584,0.33835842005547256,0.3389241383352393,0.33942740944174526,0.33987458237484197,0.34027252179870415,0.34062853406241816,0.3409502797840066,0.34124567440766745,0.3415227784648909,0.3417896795497278,0.34205436824939334,0.34232461044757556,0.34260781853490735,0.3429109241163099,0.34324025479748377,0.34360141756343876,0.343999191133234,0.3444374294910441,0.3449189785598529,0.3454456077071964,0.3460179574601254,0.34663550446743896,0.34729654439011043,0.3479981930348163,0.3479981930348163,0.34873640567969494,0.34950601418451355,0.35030078113766683,0.35111346997712223,0.3519359297382378,0.35275919283365176,0.35357358406353734,0.3543688388914952,0.3551342289041014,0.35585869230124134,0.35653096723938127,0.3571397258692089,0.3576737069701047,0.35812184518323414,0.3584733949786174,0.3587180476546654,0.35884603985634245,0.35884825230507766,0.3587162976544011,0.35844259661476874,0.3580204417240305,0.3574440483716143,0.3567085929103634,0.3558102379059823,0.354746144776798,0.35351447426298316,0.35211437533221385,0.3505459632759814,0.3488102878762337,0.34690929262488335,0.3448457660586401,0.34262328632883976,0.3402461601609048,0.3377193573717427,0.3350484421069047,0.3322395019341603,0.32929907588787743,0.32623408250105607,0.3230517487908968,0.3197595410813951,0.31636509845458677,0.312876169522813,0.3093005531096518,0.30564604331900375,0.30564604331900375,0.30192037936208926,0.2981312004027086,0.29428600557374457,0.2903921192142793,0.28645666127838326,0.2824865227750683,0.27848834601542816,0.27446850936876,0.2704331161655331,0.26638798733226493,0.26233865730240014,0.25829037271861005,0.25424809342582516,0.2502164952508556,0.2461999740734248,0.24220265071447689,0.23822837620004259,0.23428073700187016,0.23036305990835015,0.22647841623961906,0.2226296251875975,0.21881925613335973,0.2150496298687969,0.2113228187250249,0.2076406456843658,0.2040046826239231,0.20041624790474163,0.19687640357933464,0.19338595254017044,0.18994543597091973,0.1865551314895116,0.18321505238625554,0.17992494836075346,0.1766843081476701,0.17349236439372548,0.17034810110696846,0.1672502639453565,0.16419737354619182,0.16118774202268418,0.1582194926708285,0.15529058284116945,0.15239882983837816,0.14954193961954443,0.14671753797242484,0.14392320377029985,0.14115650382322184,0.13841502877872816,0.13569642947075522,0.13299845307538682,0.13031897840767986,0.12765604968617153,0.12500790810133017,0.12237302055121725,0.119750104951523,0.11713815158695938,0.11453644004531391,0.11194455136242931,0.10936237510374953,0.10679011121332734,0.1042282665715737,0.10167764631564365,0.09913934008825546,0.0966147034890165,0.0941053351041978,0.0916130495837761,0.0891398473161428,0.08668788131919697,0.08425942202002018,0.08185682063281956,0.07948247186562388,0.07713877669007511,0.07482810589578388,0.07255276512173893,0.07031496201321724,0.06811677609491767,0.06596013188133369,0.06384677566562837,0.061778256340613756,0.05975591051210097,0.05778085206820757,0.05585396627046199,0.053975908335993694,0.052147106386853354,0.0503677685545366,0.048637893946847977,0.046957287111862867,0.04532557557119729,0.04374222994307314,0.04220658613549137,0.04071786906163515,0.039275217313585686,0.03787770822645278,0.03652438277276078,0.03521426974583133,0.03394640872020855,0.032719871315953955,0.0315337803408237,0.030387326438744464,0.02927978193335293,0.028210511620323047,0.027178980330411294,0.026184757155228985,0.025227516298346228,0.02430703458412451,0.023423185724403838,0.022575931507648774,0.021765310135291864,0.02099142198481134,0.020254413127671067,0.019554456971885823,0.018891734433042116,0.018266413063630926,0.017678625588205033,0.017128448300977,0.016615879782988282,0.01614082038801228,0.015703052930154372,0.01530222498206274,0.014937833161278653,0.014609209744164398,0.0143155119027916,0.014055713810987738,0.013828601812343067,0.013632772786358906,0.013466635790107822,0.013328416992846627,0.013216167861059558,0.013127776492494043,0.013060981940946008,0.013013391319875495,0.012982499423348955,0.012965710558196303,0.012960362242432435,0.01296375039260817,0.012973155597388987,0.01298587005674204,0.012999224755932206,0.01301061644122869,0.013017533969794074,0.013017583619506914,0.013008512965145071,0.012988232954975466,0.01295483785576665,0.012906622773851214,0.012842098504294212,0.012760003508559332,0.012659312872323181,0.01253924414823527,0.01239926004239539,0.01223906795705457,0.01205861645449301,0.01185808875718285,0.011637893446263465,0.01139865256318547,0.011141187357361897,0.010866501955166056,0.010575765252130156,0.010270291350363347,0.0099515188768046,0.009620989524884781,0.00928032616257072,0.008931210843818746,0.00857536304852632,0.008214518458605921,0.007850408555390397,0.0074847412968736295,0.007119183103025584,0.006755342344374498,0.006394754494027628,0.00603886906711888,0.005689038435127018,0.005346508566370905,0.005012411708977304,0.004687760999387996,0.004373446948604301,0.004070235730350345,0.0037787691705688875,0.0034995663164444713,0.003233026445677392,0.0029794333631099875,0.002738960822040395,0.0025116789015672647,0.0022975611689303307,0.002096492456814911,0.0019082770896823855,0.0017326474000355918,0.0015692723847540776,0.001417766362842944,0.0012776975087226943,0.0011485961491379728,0.0010299627264826745,9.212753464486749E-4,8.219968430536491E-4,7.315813089713342E-4,6.494800533943469E-4,5.751469631657894E-4,5.080432554248934E-4,4.476416213709788E-4,3.934297708490284E-4,3.449133962300959E-4,3.016185814697833E-4,2.630936882820091E-4,2.289107560978074E-4,1.9866645595072123E-4,1.7198264072387646E-4,1.485065354082883E-4,1.2791061126912856E-4,1.0989218721599391E-4,9.417280034849416E-5,8.049738572352667E-5,6.863330298665625E-5,5.836924474272741E-5,4.951405851826728E-5,4.189551098914524E-5,3.535901989964775E-5,2.9766375860707164E-5,2.4994473051113036E-5,2.0934064810281626E-5,1.7488557247616058E-5,1.457285133419971E-5,1.2112241510359912E-5,1.004137665158739E-5,8.303287291719055E-6,6.848481305854512E-6,5.634108800268299E-6,4.623195732180997E-6,3.7839447747394952E-6,3.0891011354436595E-6,2.5153804113411394E-6,2.042955102424725E-6,1.6549960863199612E-6,1.33726516327696E-6,1.0777546920755169E-6,8.663703371144813E-7,6.946530183423193E-7,5.555362838818939E-7,4.4313549682783447E-7,3.5256543094168896E-7,2.797830945952681E-7,2.2145283958860845E-7,1.7483105410197448E-7,1.3766798106926217E-7,1.0812443993260914E-7,8.470145738939039E-8,6.618102866126189E-8,5.15764331126244E-8,4.009071553403015E-8,3.108211647724651E-8,2.4035391548434863E-8,1.853810077477144E-8,1.4261075586354268E-8,1.0942383340202006E-8,8.374208544730117E-9,6.392157002400639E-9,4.866565004562208E-9,3.695461527291444E-9,2.7988881158342357E-9,2.114329796334446E-9,1.5930518526720942E-9,1.1971725262007169E-9,8.973314405335526E-10,6.708385536533543E-10,5.002093543571346E-10,3.720094373689221E-10,2.7594603158558504E-10,2.0415597548096128E-10,1.5064943048509858E-10,0.006647155317401156,0.006774531995963658,0.0069007459176468255,0.007025832186221412,0.007149836556238942,0.007272814455747488,0.007394829899339338,0.00751595430282222,0.0076362652120616934,0.007755844959665102,0.007874779264153165,0.007993155787083796,0.008111062664245468,0.008228587027518395,0.00834581353430618,0.008462822921569458,0.008579690601444534,0.008696485315209291,0.008813267861970318,0.008930089917895704,0.00904699296111739,0.009164007316583813,0.009281151334170571,0.009398430712265333,0.009515837977846157,0.009633352132783157,0.009750938474725713,0.00986854859950307,0.009986120590479968,0.010103579398781794,0.010220837416748396,0.01033779524540201,0.010454342655134969,0.010570359737243242,0.01068571824236432,0.010800283100327041,0.010913914114395622,0.01102646782139549,0.011137799507750814,0.01124776537004771,0.011356224807368318,0.011463042831324877,0.011568092578463448,0.011671257908511389,0.011772436070815313,0.011871540420265532,0.011968503163034208,0.012063278111578132,0.012155843427579902,0.012246204330835573,0.012334395751550733,0.012420484903094841,0.012504573751994263,0.0125868013618341,0.012667346087796065,0.012746427598800293,0.012824308704654246,0.012901296966251247,0.012977746067719079,0.013054056930500149,0.013130678550658602,0.01320810854226108,0.013286893371466591,0.013367628267989843,0.01345095680286322,0.013537570123911461,0.013628205843054646,0.013723646572457447,0.013824718109622552,0.013932287274761835,0.01404725940714145,0.014170575530555478,0.014303209201598121,0.01444616305794198,0.014600465087343107,0.014767164641540174,0.014947328222544886,0.015142035071990462,0.015352372597158654,0.015579431670001065,0.015824301837853733,0.016088066486572475,0.01637179799844479,0.01667655294842209,0.017003367382928167,0.01735325222570491,0.017727188854831162,0.018126124894173888,0.018550970261097404,0.019002593510257813,0.019481818510756085,0.019989421490827407,0.020526128480629246,0.021092613179589822,0.021689495270231958,0.022317339195445943,0.022976653410903783,0.02366789011875546,0.024391445482992383,0.025147660320984876,0.025936821259780415,0.026759162339871273,0.02761486704339495,0.02850407071820194,0.0294268633640042,0.03038329274198883,0.031373367764921285,0.0323970621209541,0.033454318081162546,0.034545050438313234,0.035669150522581156,0.036826490238911755,0.03801692607049729,0.039240302993422585,0.04049645824893501,0.04178522492198915,0.04310643527769522,0.04445992381100681,0.045845529969377935,0.04726310051312707,0.048712491483795424,0.05019356975678187,0.05170621416088944,0.05325031615401277,0.05482578005092508,0.05643252280587508,0.05807047335934708,0.05973957156477346,0.06143976671708585,0.0631710157106447,0.06493328085919793,0.06672652741498658,0.06855072082785722,0.07040582378819002,0.07229179309954897,0.0742085764281653,0.07615610897666052,0.07813431012878297,0.0801430801104045,0.0821822967096103,0.08425181209548083,0.08635144977117042,0.08848100169221473,0.09064022557574666,0.09282884242058215,0.09504653425207399,0.09729294209934283,0.09956766420615232,0.10187025447038905,0.1042002211010384,0.10655702547580191,0.10894008117726413,0.11134875318087774,0.11378235716414428,0.11624015890329956,0.11872137372169717,0.12122516595294827,0.12375064838181911,0.1262968816269044,0.12886287343122665,0.13144757783013147,0.13404989417011579,0.13666866595750657,0.13930267952210232,0.14195066248789892,0.1446112820507409,0.14728314307101242,0.14996478599816962,0.15265468465283683,0.15535124390118868,0.15805279726520433,0.16075760452094662,0.16346384934509509,0.16616963707734247,0.16887299267280365,0.17157185892408536,0.1742640950369887,0.17694747564681867,0.17961969036383674,0.18227834393641248,0.18492095711885154,0.18754496832762865,0.1901477361648327,0.19272654288105381,0.19527859884171422,0.19780104805108067,0.20029097477693575,0.20274541130632598,0.2051613468489996,0.20753573759037966,0.20986551788027893,0.21214761252735767,0.21437895015271521,0.21655647753927856,0.21867717489704802,0.22073807194799927,0.2227362647188802,0.224668932915395,0.2265333577377103,0.2283269399850096,0.23004721828621225,0.23169188728513557,0.2332588156015467,0.23474606338477902,0.23615189927412442,0.2374748165800057,0.23871354850218776,0.23986708220587435,0.2409346715835943,0.2409346715835943,0.24191584854010525,0.2428104326492199,0.24361853904517147,0.2443405844269337,0.24497729107144006,0.24552968877079556,0.2459991146290796,0.24638721067589991,0.24669591927625878,0.2469274763391967,0.24708440235077112,0.24716949127995833,0.24718579742865676,0.2471366203188562,0.24702548773092328,0.24685613702653536,0.24663249490783123,0.246358655780598,0.24603885890354346,0.24567746451776123,0.2452789291601995,0.24484778037220697,0.24438859101895058,0.2439059534376472,0.24340445363211732,0.24288864572821417,0.2423630268992138,0.24183201296247467,0.241299914838639,0.24077091605257336,0.24024905144133388,0.23973818721889203,0.23924200253043698,0.23876397261100693,0.23830735364432643,0.2378751693982347,0.23747019969332755,0.23709497074164015,0.23675174737266352,0.23644252714493363,0.23616903632314007,0.23593272768336948,0.2357347800929204,0.2355760997962956,0.23545732332561614,0.23537882194195425,0.23534070750399838,0.2353428396521462,0.23538483418955417,0.23546607253688578,0.23558571213444185,0.23574269766398903,0.2359357729628207,0.23616349350432891,0.23642423932245824,0.23671622826177777,0.23703752944035955,0.23738607681904836,0.23775968277788678,0.23815605160826941,0.23857279283765698,0.2390074343122475,0.2390074343122475,0.23945743497173028,0.23992019725897148,0.24039307911611613,0.2408734055269619,0.2413584795735323,0.24184559298241154,0.24233203614354423,0.24281510759082242,0.24329212293978997,0.24376042328321973,0.2442173830500958,0.24466041733772628,0.24508698873025797,0.2454946136198652,0.24588086804930345,0.24624339309642695,0.24657989982270845,0.24688817380878125,0.24716607930063408,0.24741156299034228,0.24762265745515216,0.24779748427843226,0.2479342568754309,0.24803128304602745,0.24808696727573853,0.2480998128051425,0.24806842348666588,0.24799150544633825,0.24786786856664556,0.2476964278050603,0.2474762043611477,0.24720632670337297,0.24688603146487167,0.24651466421546672,0.2460916801151701,0.24561664445223905,0.24508923306666425,0.24450923265765437,0.24387654097137193,0.24319116686281306,0.2424532302233786,0.24166296176337643,0.24082070263645247,0.23992690389082597,0.23898212573023567,0.23798703656574144,0.23694241183801185,0.235849132588509,0.23470818375712746,0.23352065218334947,0.2322877242879509,0.2310106834127084,0.22969090679649398,0.2283298621675831,0.22692910393400548,0.22549026895629143,0.22401507189005193,0.22250530008942618,0.2209628080665368,0.21938951150665725,0.21778738084377858,0.21615843440659716,0.21615843440659716,0.2145047311505833,0.21282836299761893,0.21113144681067408,0.20941611603698265,0.20768451205913613,0.20593877529928925,0.20418103612719768,0.20241340562796986,0.2006379662901159,0.1988567626786168,0.19707179216124157,0.19528499575911368,0.1934982491945011,0.1917133542099318,0.18993203023294278,0.18815590646005245,0.18638651443185814,0.184625281168507,0.18287352293119125,0.18113243967078016,0.17940311021928756,0.17768648827362224,0.17598339921406844,0.17429453779225934,0.17262046671515496,0.17096161614280653,0.16931828410861247,0.1676906378614568,0.16607871611970945,0.16448243221767941,0.16290157811588837,0.16133582923759252,0.15978475008546644,0.15824780058437896,0.15672434308886585,0.15521364998733414,0.1537149118293077,0.1522272458972365,0.15074970514059227,0.1492812873872222,0.14782094474526505,0.1463675931083581,0.14492012167739277,0.1434774024136864,0.14203829934109863,0.14060167761828374,0.1391664123068702,0.13773139676682358,0.1362955506164754,0.13485782720160405,0.13341722052540714,0.13197277159909954,0.13052357418107927,0.12906877988099513,0.12760760261350368,0.12613932239487788,0.12466328848381533,0.12317892187565854,0.12168571716667537,0.1201832438119495,0.11867114680670421,0.11714914682644711,0.11561703986610833,0.11407469642229659,0.11252206026587915,0.11095914685427616,0.10938604143413619,0.10780289688544861,0.10620993135765044,0.10460742574696115,0.10299572106206005,0.10137521572238553,0.09974636282984634,0.09810966745068911,0.09646568393974221,0.09481501333436908,0.09315830084030083,0.09149623342619954,0.0898295375384249,0.08815897694215033,0.08648535068979751,0.08480949121282962,0.08313226252835085,0.08145455854778644,0.07977730147123091,0.0781014402479196,0.07642794908073972,0.07475782595079745,0.07309209113681069,0.07143178570352263,0.06977796993341784,0.06813172167675947,0.06649413459632257,0.06486631628513859,0.06324938623803406,0.06164447366068956,0.06005271510329395,0.058475251909546,0.05691322747569205,0.055367784318392725,0.053840060954407895,0.052331188599289875,0.05084228769640249,0.04937446429155467,0.04792880627228516,0.04650637949428399,0.045108223820533803,0.04373534910144084,0.04238873112646322,0.04106930757949463,0.03977797403150447,0.03851558000465371,0.03728292514229738,0.036080755518955517,0.034909760123498536,0.03377056754747741,0.03266374290876404,0.031589785038492225,0.030549123956755322,0.029542118659665734,0.02856905523727763,0.02763014533856927,0.02672552499623698,0.025855253820527554,0.02501931456778854,0.02421761308590203,0.023449978635341172,0.022716164581297917,0.022015849449220123,0.02134863833320436,0.020714064644049922,0.020111592181415873,0.019540617512455227,0.01900047263754124,0.018490427922255963,0.018009695273679502,0.017557431538193558,0.017132742097481682,0.01673468463915397,0.016362273078423688,0.016014481607492262,0.015690248849728278,0.015388482096326251,0.015108061603869991,0.014847844932071782,0.014606671301881915,0.014383365955132475,0.014176744497868148,0.013985617210498687,0.013808793308861705,0.013645085141190963,0.013493312306830308,0.013352305683305999,0.013220911349063455,0.01309799438978667,0.012982442576750347,0.012873169906112293,0.01276911998844464,0.012669269278139359,0.01257263013261991,0.012478253691563239,0.012385232566602178,0.012292703332255803,0.01219984880914353,0.012105900130895313,0.012010138586592967,0.011911897231082071,0.011810562256093383,0.01170557411581931,0.011596428401412553,0.011482676459816162,0.01136392575339948,0.011239839958060507,0.011110138798758424,0.010974597622851275,0.010833046713122211,0.010685370343968588,0.010531505585883979,0.010371440865064929],\n"..quantile..":[0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],\n"rating":[-3.5238731400523644,-3.5072734487391575,-3.4906737574259505,-3.4740740661127436,-3.4574743747995367,-3.4408746834863297,-3.424274992173123,-3.407675300859916,-3.391075609546709,-3.374475918233502,-3.357876226920295,-3.341276535607088,-3.324676844293881,-3.3080771529806743,-3.2914774616674674,-3.2748777703542604,-3.2582780790410535,-3.2416783877278466,-3.2250786964146396,-3.2084790051014327,-3.1918793137882258,-3.175279622475019,-3.158679931161812,-3.142080239848605,-3.125480548535398,-3.108880857222191,-3.092281165908984,-3.0756814745957772,-3.0590817832825703,-3.0424820919693634,-3.0258824006561564,-3.0092827093429495,-2.9926830180297426,-2.9760833267165356,-2.9594836354033287,-2.9428839440901218,-2.926284252776915,-2.909684561463708,-2.893084870150501,-2.876485178837294,-2.859885487524087,-2.8432857962108797,-2.826686104897673,-2.810086413584466,-2.793486722271259,-2.776887030958052,-2.760287339644845,-2.743687648331638,-2.727087957018431,-2.7104882657052243,-2.6938885743920173,-2.6772888830788104,-2.6606891917656035,-2.6440895004523965,-2.6274898091391896,-2.6108901178259827,-2.5942904265127757,-2.577690735199569,-2.561091043886362,-2.544491352573155,-2.527891661259948,-2.511291969946741,-2.494692278633534,-2.4780925873203272,-2.4614928960071203,-2.4448932046939134,-2.4282935133807064,-2.4116938220674995,-2.3950941307542926,-2.3784944394410856,-2.3618947481278787,-2.3452950568146718,-2.328695365501465,-2.312095674188258,-2.295495982875051,-2.278896291561844,-2.262296600248637,-2.24569690893543,-2.2290972176222232,-2.2124975263090163,-2.1958978349958094,-2.179298143682602,-2.162698452369395,-2.146098761056188,-2.129499069742981,-2.1128993784297743,-2.0962996871165673,-2.0796999958033604,-2.0631003044901535,-2.0465006131769465,-2.0299009218637396,-2.0133012305505327,-1.996701539237326,-1.980101847924119,-1.963502156610912,-1.9469024652977052,-1.9303027739844982,-1.9137030826712913,-1.8971033913580844,-1.8805037000448774,-1.8639040087316705,-1.8473043174184636,-1.8307046261052566,-1.8141049347920497,-1.7975052434788428,-1.7809055521656358,-1.764305860852429,-1.747706169539222,-1.731106478226015,-1.7145067869128081,-1.6979070955996012,-1.6813074042863942,-1.664707712973187,-1.6481080216599802,-1.6315083303467732,-1.6149086390335663,-1.5983089477203594,-1.5817092564071524,-1.5651095650939455,-1.5485098737807386,-1.5319101824675316,-1.5153104911543247,-1.4987107998411178,-1.4821111085279108,-1.465511417214704,-1.448911725901497,-1.43231203458829,-1.415712343275083,-1.3991126519618762,-1.3825129606486692,-1.3659132693354623,-1.3493135780222554,-1.3327138867090484,-1.3161141953958415,-1.2995145040826346,-1.2829148127694276,-1.2663151214562207,-1.2497154301430138,-1.2331157388298069,-1.2165160475166,-1.199916356203393,-1.183316664890186,-1.1667169735769791,-1.1501172822637722,-1.1335175909505653,-1.1169178996373583,-1.1003182083241514,-1.0837185170109445,-1.0671188256977375,-1.0505191343845306,-1.0339194430713237,-1.0173197517581167,-1.0007200604449098,-0.9841203691317029,-0.9675206778184959,-0.950920986505289,-0.950920986505289,-0.9343212951920821,-0.9177216038788751,-0.9011219125656682,-0.8845222212524613,-0.8679225299392543,-0.851322838626047,-0.83472314731284,-0.8181234559996331,-0.8015237646864262,-0.7849240733732192,-0.7683243820600123,-0.7517246907468054,-0.7351249994335984,-0.7185253081203915,-0.7019256168071846,-0.6853259254939776,-0.6687262341807707,-0.6521265428675638,-0.6355268515543568,-0.6189271602411499,-0.602327468927943,-0.585727777614736,-0.5691280863015291,-0.5525283949883222,-0.5359287036751152,-0.5193290123619083,-0.5027293210487014,-0.48612962973549445,-0.4695299384222875,-0.4529302471090806,-0.43633055579587365,-0.4197308644826667,-0.4031311731694598,-0.38653148185625286,-0.3699317905430459,-0.353332099229839,-0.33673240791663206,-0.3201327166034251,-0.3035330252902182,-0.28693333397701126,-0.27033364266380433,-0.2537339513505974,-0.23713426003739047,-0.22053456872418353,-0.2039348774109766,-0.2039348774109766,-0.18733518609776967,-0.17073549478456274,-0.1541358034713558,-0.13753611215814887,-0.12093642084494194,-0.104336729531735,-0.08773703821852807,-0.07113734690532114,-0.05453765559211421,-0.03793796427890728,-0.021338272965700344,-0.004738581652493412,0.01186110966071352,0.028460800973920453,0.045060492287127385,0.06166018360033432,0.07825987491354125,0.09485956622674818,0.11145925753995511,0.12805894885316205,0.14465864016636898,0.1612583314795759,0.17785802279278284,0.19445771410599022,0.21105740541919715,0.22765709673240409,0.24425678804561102,0.26085647935881795,0.2774561706720249,0.2940558619852318,0.31065555329843875,0.3272552446116457,0.3438549359248526,0.36045462723805954,0.3770543185512665,0.3936540098644734,0.41025370117768034,0.4268533924908873,0.4434530838040942,0.46005277511730114,0.47665246643050807,0.493252157743715,0.5098518490569219,0.5264515403701289,0.5264515403701289,0.5430512316833358,0.5596509229965427,0.5762506143097497,0.5928503056229566,0.6094499969361635,0.6260496882493705,0.6426493795625774,0.6592490708757843,0.6758487621889913,0.6924484535021982,0.7090481448154051,0.7256478361286121,0.742247527441819,0.7588472187550259,0.7754469100682329,0.7920466013814398,0.8086462926946467,0.8252459840078537,0.8418456753210606,0.8584453666342675,0.8750450579474744,0.8916447492606814,0.9082444405738883,0.9248441318870952,0.9414438232003022,0.9580435145135091,0.974643205826716,0.991242897139923,1.00784258845313,1.0244422797663368,1.0410419710795438,1.0576416623927507,1.0742413537059576,1.0908410450191646,1.1074407363323715,1.1240404276455784,1.1406401189587854,1.1572398102719923,1.1738395015851992,1.1904391928984062,1.207038884211613,1.22363857552482,1.240238266838027,1.256837958151234,1.2734376494644408,1.2900373407776478,1.3066370320908547,1.3232367234040616,1.3398364147172686,1.3564361060304755,1.3730357973436824,1.3896354886568894,1.4062351799700963,1.4228348712833032,1.4394345625965101,1.456034253909717,1.472633945222924,1.489233636536131,1.5058333278493379,1.5224330191625448,1.5390327104757517,1.5556324017889587,1.5722320931021656,1.5888317844153725,1.6054314757285795,1.6220311670417864,1.6386308583549933,1.6552305496682003,1.6718302409814072,1.6884299322946141,1.705029623607821,1.721629314921028,1.738229006234235,1.7548286975474419,1.7714283888606488,1.7880280801738557,1.8046277714870635,1.8212274628002705,1.8378271541134774,1.8544268454266843,1.8710265367398913,1.8876262280530982,1.9042259193663051,1.920825610679512,1.937425301992719,1.954024993305926,1.9706246846191329,1.9872243759323398,2.0038240672455467,2.0204237585587537,2.0370234498719606,2.0536231411851675,2.0702228324983745,2.0868225238115814,2.1034222151247883,2.1200219064379953,2.136621597751202,2.153221289064409,2.169820980377616,2.186420671690823,2.20302036300403,2.219620054317237,2.236219745630444,2.2528194369436507,2.2694191282568577,2.2860188195700646,2.3026185108832715,2.3192182021964785,2.3358178935096854,2.3524175848228923,2.3690172761360992,2.385616967449306,2.402216658762513,2.41881635007572,2.435416041388927,2.452015732702134,2.468615424015341,2.4852151153285478,2.5018148066417547,2.5184144979549616,2.5350141892681686,2.5516138805813755,2.5682135718945824,2.5848132632077894,2.6014129545209963,2.6180126458342032,2.63461233714741,2.651212028460617,2.667811719773824,2.684411411087031,2.701011102400238,2.717610793713445,2.7342104850266518,2.7508101763398587,2.7674098676530656,2.7840095589662726,2.8006092502794795,2.8172089415926864,2.8338086329058934,2.8504083242191003,2.867008015532307,2.883607706845514,2.900207398158721,2.916807089471928,2.933406780785135,2.950006472098342,2.966606163411549,2.9832058547247557,2.9998055460379627,3.0164052373511696,3.0330049286643765,3.0496046199775835,3.0662043112907904,3.0828040026039973,3.0994036939172043,3.116003385230411,3.132603076543618,3.149202767856825,3.165802459170032,3.182402150483239,3.199001841796446,3.215601533109653,3.2322012244228597,3.2488009157360667,3.2654006070492736,3.2820002983624805,3.2985999896756875,3.3151996809888944,3.3317993723021013,3.3483990636153083,3.364998754928515,3.381598446241722,3.398198137554929,3.414797828868136,3.431397520181343,3.44799721149455,3.464596902807757,3.4811965941209637,3.4977962854341706,3.5143959767473776,3.5309956680605845,3.5475953593737914,3.5641950506869984,3.5807947420002053,3.5973944333134122,3.613994124626619,3.630593815939826,3.647193507253033,3.66379319856624,3.680392889879447,3.696992581192654,3.7135922725058608,3.7301919638190677,3.7467916551322746,3.7633913464454816,3.7799910377586885,3.7965907290718954,3.8131904203851024,3.8297901116983093,3.8463898030115162,3.862989494324723,3.87958918563793,3.896188876951137,3.912788568264345,3.929388259577552,3.9459879508907587,3.9625876422039656,3.9791873335171726,3.9957870248303795,4.012386716143586,4.028986407456793,4.04558609877,4.062185790083207,4.078785481396414,4.095385172709621,4.111984864022828,4.128584555336035,4.145184246649242,4.161783937962449,4.178383629275656,4.194983320588863,4.21158301190207,4.228182703215277,4.2447823945284835,4.26138208584169,4.277981777154897,4.294581468468104,4.311181159781311,4.327780851094518,4.344380542407725,4.360980233720932,4.377579925034139,4.394179616347346,4.410779307660553,4.42737899897376,4.443978690286967,4.460578381600174,4.4771780729133805,4.4937777642265875,4.510377455539794,4.526977146853001,4.543576838166208,4.560176529479415,4.576776220792622,4.593375912105829,4.609975603419036,4.626575294732243,4.64317498604545,4.659774677358657,4.676374368671864,4.692974059985071,4.709573751298278,4.7261734426114845,4.7427731339246915,4.759372825237898,4.775972516551105,4.792572207864312,4.809171899177519,4.825771590490726,4.842371281803933,4.85897097311714,4.875570664430347,4.892170355743554,4.908770047056761,4.925369738369968,4.941969429683175,4.958569120996382,-3.5238731400523644,-3.5072734487391575,-3.4906737574259505,-3.4740740661127436,-3.4574743747995367,-3.4408746834863297,-3.424274992173123,-3.407675300859916,-3.391075609546709,-3.374475918233502,-3.357876226920295,-3.341276535607088,-3.324676844293881,-3.3080771529806743,-3.2914774616674674,-3.2748777703542604,-3.2582780790410535,-3.2416783877278466,-3.2250786964146396,-3.2084790051014327,-3.1918793137882258,-3.175279622475019,-3.158679931161812,-3.142080239848605,-3.125480548535398,-3.108880857222191,-3.092281165908984,-3.0756814745957772,-3.0590817832825703,-3.0424820919693634,-3.0258824006561564,-3.0092827093429495,-2.9926830180297426,-2.9760833267165356,-2.9594836354033287,-2.9428839440901218,-2.926284252776915,-2.909684561463708,-2.893084870150501,-2.876485178837294,-2.859885487524087,-2.8432857962108797,-2.826686104897673,-2.810086413584466,-2.793486722271259,-2.776887030958052,-2.760287339644845,-2.743687648331638,-2.727087957018431,-2.7104882657052243,-2.6938885743920173,-2.6772888830788104,-2.6606891917656035,-2.6440895004523965,-2.6274898091391896,-2.6108901178259827,-2.5942904265127757,-2.577690735199569,-2.561091043886362,-2.544491352573155,-2.527891661259948,-2.511291969946741,-2.494692278633534,-2.4780925873203272,-2.4614928960071203,-2.4448932046939134,-2.4282935133807064,-2.4116938220674995,-2.3950941307542926,-2.3784944394410856,-2.3618947481278787,-2.3452950568146718,-2.328695365501465,-2.312095674188258,-2.295495982875051,-2.278896291561844,-2.262296600248637,-2.24569690893543,-2.2290972176222232,-2.2124975263090163,-2.1958978349958094,-2.179298143682602,-2.162698452369395,-2.146098761056188,-2.129499069742981,-2.1128993784297743,-2.0962996871165673,-2.0796999958033604,-2.0631003044901535,-2.0465006131769465,-2.0299009218637396,-2.0133012305505327,-1.996701539237326,-1.980101847924119,-1.963502156610912,-1.9469024652977052,-1.9303027739844982,-1.9137030826712913,-1.8971033913580844,-1.8805037000448774,-1.8639040087316705,-1.8473043174184636,-1.8307046261052566,-1.8141049347920497,-1.7975052434788428,-1.7809055521656358,-1.764305860852429,-1.747706169539222,-1.731106478226015,-1.7145067869128081,-1.6979070955996012,-1.6813074042863942,-1.664707712973187,-1.6481080216599802,-1.6315083303467732,-1.6149086390335663,-1.5983089477203594,-1.5817092564071524,-1.5651095650939455,-1.5485098737807386,-1.5319101824675316,-1.5153104911543247,-1.4987107998411178,-1.4821111085279108,-1.465511417214704,-1.448911725901497,-1.43231203458829,-1.415712343275083,-1.3991126519618762,-1.3825129606486692,-1.3659132693354623,-1.3493135780222554,-1.3327138867090484,-1.3161141953958415,-1.2995145040826346,-1.2829148127694276,-1.2663151214562207,-1.2497154301430138,-1.2331157388298069,-1.2165160475166,-1.199916356203393,-1.183316664890186,-1.1667169735769791,-1.1501172822637722,-1.1335175909505653,-1.1169178996373583,-1.1003182083241514,-1.0837185170109445,-1.0671188256977375,-1.0505191343845306,-1.0339194430713237,-1.0173197517581167,-1.0007200604449098,-0.9841203691317029,-0.9675206778184959,-0.950920986505289,-0.9343212951920821,-0.9177216038788751,-0.9011219125656682,-0.8845222212524613,-0.8679225299392543,-0.851322838626047,-0.83472314731284,-0.8181234559996331,-0.8015237646864262,-0.7849240733732192,-0.7683243820600123,-0.7517246907468054,-0.7351249994335984,-0.7185253081203915,-0.7019256168071846,-0.6853259254939776,-0.6687262341807707,-0.6521265428675638,-0.6355268515543568,-0.6189271602411499,-0.602327468927943,-0.585727777614736,-0.5691280863015291,-0.5525283949883222,-0.5359287036751152,-0.5193290123619083,-0.5027293210487014,-0.48612962973549445,-0.4695299384222875,-0.4529302471090806,-0.43633055579587365,-0.4197308644826667,-0.4031311731694598,-0.38653148185625286,-0.3699317905430459,-0.353332099229839,-0.33673240791663206,-0.3201327166034251,-0.3035330252902182,-0.28693333397701126,-0.27033364266380433,-0.2537339513505974,-0.23713426003739047,-0.22053456872418353,-0.2039348774109766,-0.18733518609776967,-0.17073549478456274,-0.1541358034713558,-0.13753611215814887,-0.12093642084494194,-0.104336729531735,-0.08773703821852807,-0.07113734690532114,-0.07113734690532114,-0.05453765559211421,-0.03793796427890728,-0.021338272965700344,-0.004738581652493412,0.01186110966071352,0.028460800973920453,0.045060492287127385,0.06166018360033432,0.07825987491354125,0.09485956622674818,0.11145925753995511,0.12805894885316205,0.14465864016636898,0.1612583314795759,0.17785802279278284,0.19445771410599022,0.21105740541919715,0.22765709673240409,0.24425678804561102,0.26085647935881795,0.2774561706720249,0.2940558619852318,0.31065555329843875,0.3272552446116457,0.3438549359248526,0.36045462723805954,0.3770543185512665,0.3936540098644734,0.41025370117768034,0.4268533924908873,0.4434530838040942,0.46005277511730114,0.47665246643050807,0.493252157743715,0.5098518490569219,0.5264515403701289,0.5430512316833358,0.5596509229965427,0.5762506143097497,0.5928503056229566,0.6094499969361635,0.6260496882493705,0.6426493795625774,0.6592490708757843,0.6758487621889913,0.6924484535021982,0.7090481448154051,0.7256478361286121,0.742247527441819,0.7588472187550259,0.7754469100682329,0.7920466013814398,0.8086462926946467,0.8252459840078537,0.8418456753210606,0.8584453666342675,0.8750450579474744,0.8916447492606814,0.9082444405738883,0.9248441318870952,0.9414438232003022,0.9580435145135091,0.9580435145135091,0.974643205826716,0.991242897139923,1.00784258845313,1.0244422797663368,1.0410419710795438,1.0576416623927507,1.0742413537059576,1.0908410450191646,1.1074407363323715,1.1240404276455784,1.1406401189587854,1.1572398102719923,1.1738395015851992,1.1904391928984062,1.207038884211613,1.22363857552482,1.240238266838027,1.256837958151234,1.2734376494644408,1.2900373407776478,1.3066370320908547,1.3232367234040616,1.3398364147172686,1.3564361060304755,1.3730357973436824,1.3896354886568894,1.4062351799700963,1.4228348712833032,1.4394345625965101,1.456034253909717,1.472633945222924,1.489233636536131,1.5058333278493379,1.5224330191625448,1.5390327104757517,1.5556324017889587,1.5722320931021656,1.5888317844153725,1.6054314757285795,1.6220311670417864,1.6386308583549933,1.6552305496682003,1.6718302409814072,1.6884299322946141,1.705029623607821,1.721629314921028,1.738229006234235,1.7548286975474419,1.7714283888606488,1.7880280801738557,1.8046277714870635,1.8212274628002705,1.8378271541134774,1.8544268454266843,1.8710265367398913,1.8876262280530982,1.9042259193663051,1.920825610679512,1.937425301992719,1.954024993305926,1.9706246846191329,1.9872243759323398,1.9872243759323398,2.0038240672455467,2.0204237585587537,2.0370234498719606,2.0536231411851675,2.0702228324983745,2.0868225238115814,2.1034222151247883,2.1200219064379953,2.136621597751202,2.153221289064409,2.169820980377616,2.186420671690823,2.20302036300403,2.219620054317237,2.236219745630444,2.2528194369436507,2.2694191282568577,2.2860188195700646,2.3026185108832715,2.3192182021964785,2.3358178935096854,2.3524175848228923,2.3690172761360992,2.385616967449306,2.402216658762513,2.41881635007572,2.435416041388927,2.452015732702134,2.468615424015341,2.4852151153285478,2.5018148066417547,2.5184144979549616,2.5350141892681686,2.5516138805813755,2.5682135718945824,2.5848132632077894,2.6014129545209963,2.6180126458342032,2.63461233714741,2.651212028460617,2.667811719773824,2.684411411087031,2.701011102400238,2.717610793713445,2.7342104850266518,2.7508101763398587,2.7674098676530656,2.7840095589662726,2.8006092502794795,2.8172089415926864,2.8338086329058934,2.8504083242191003,2.867008015532307,2.883607706845514,2.900207398158721,2.916807089471928,2.933406780785135,2.950006472098342,2.966606163411549,2.9832058547247557,2.9998055460379627,3.0164052373511696,3.0330049286643765,3.0496046199775835,3.0662043112907904,3.0828040026039973,3.0994036939172043,3.116003385230411,3.132603076543618,3.149202767856825,3.165802459170032,3.182402150483239,3.199001841796446,3.215601533109653,3.2322012244228597,3.2488009157360667,3.2654006070492736,3.2820002983624805,3.2985999896756875,3.3151996809888944,3.3317993723021013,3.3483990636153083,3.364998754928515,3.381598446241722,3.398198137554929,3.414797828868136,3.431397520181343,3.44799721149455,3.464596902807757,3.4811965941209637,3.4977962854341706,3.5143959767473776,3.5309956680605845,3.5475953593737914,3.5641950506869984,3.5807947420002053,3.5973944333134122,3.613994124626619,3.630593815939826,3.647193507253033,3.66379319856624,3.680392889879447,3.696992581192654,3.7135922725058608,3.7301919638190677,3.7467916551322746,3.7633913464454816,3.7799910377586885,3.7965907290718954,3.8131904203851024,3.8297901116983093,3.8463898030115162,3.862989494324723,3.87958918563793,3.896188876951137,3.912788568264345,3.929388259577552,3.9459879508907587,3.9625876422039656,3.9791873335171726,3.9957870248303795,4.012386716143586,4.028986407456793,4.04558609877,4.062185790083207,4.078785481396414,4.095385172709621,4.111984864022828,4.128584555336035,4.145184246649242,4.161783937962449,4.178383629275656,4.194983320588863,4.21158301190207,4.228182703215277,4.2447823945284835,4.26138208584169,4.277981777154897,4.294581468468104,4.311181159781311,4.327780851094518,4.344380542407725,4.360980233720932,4.377579925034139,4.394179616347346,4.410779307660553,4.42737899897376,4.443978690286967,4.460578381600174,4.4771780729133805,4.4937777642265875,4.510377455539794,4.526977146853001,4.543576838166208,4.560176529479415,4.576776220792622,4.593375912105829,4.609975603419036,4.626575294732243,4.64317498604545,4.659774677358657,4.676374368671864,4.692974059985071,4.709573751298278,4.7261734426114845,4.7427731339246915,4.759372825237898,4.775972516551105,4.792572207864312,4.809171899177519,4.825771590490726,4.842371281803933,4.85897097311714,4.875570664430347,4.892170355743554,4.908770047056761,4.925369738369968,4.941969429683175,4.958569120996382],\n"cond":["A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B","B"]\n}\n}],\n"metainfo_list":[]\n};\n       var plotContainer = document.getElementById("0n7UpK");\n       LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n   </script>\n   </body>\n</html>'

aa

In my case, marimo is working OK with other plotting packages.

@alshan
Copy link
Collaborator

alshan commented Jul 8, 2024

Apparently marimo has its own system for handling and displaying outputs, which differs from traditional Jupyter notebooks.
AFAIU for some commonly used libraries, marimo team includes built-in support out of the box as well as creates adapters or plugins for popular visualization libraries.
Maybe a good idea would be to ask marimo to create such an adapter for lets-plot.

@VivaldoMendes
Copy link
Author

Thank you very much for your help. You have developed a very nice package. I will pass that information to them.

@signup2k
Copy link

signup2k commented Aug 9, 2024

@VivaldoMendes

try this, which works in my mamrio.

p = lp.ggplot(data, lp.aes(x='trade_date', y='price', color='symbol')) + lp.geom_line()
fig = p.to_html(iframe=True) # This is important, if you want the rendering as html
ui.Html(fig)

@VivaldoMendes
Copy link
Author

@signup2k, Thanks. Unfortunately, your code does not work in my case. I get the following error:

NameError: name 'ui' is not defined

If I remove ui.Html(fig) from your code, I do not get any error, but the plot is nowhere to be seen, which was what I used to get on my first attempt with lets-plot in marimo.

@signup2k
Copy link

@signup2k, Thanks. Unfortunately, your code does not work in my case. I get the following error:

NameError: name 'ui' is not defined

If I remove ui.Html(fig) from your code, I do not get any error, but the plot is nowhere to be seen, which was what I used to get on my first attempt with lets-plot in marimo.

I am so sorry for this typo...It's actually mo.Html(fig), where mo comes from import marimo as mo

image

@VivaldoMendes
Copy link
Author

I'm sorry, but your code doesn't work. Can you provide a full-fledged MWE that I can use to replicate it?

@signup2k
Copy link

I'm sorry, but your code doesn't work. Can you provide a full-fledged MWE that I can use to replicate it?

actually, it's quite simple...

import marimo as mo
import numpy as np
import importlib
import pandas as pd

import lets_plot as lp
lp.LetsPlot.setup_html()

# create dataframe
# create date
dates = pd.date_range(start='2024-01-01', end='2024-01-15')

# add symbols
symbols = ['MSFT', 'NVDA', 'AAPL']

# combine date and symbols
df = pd.DataFrame([(date, symbol) for date in dates for symbol in symbols], 
                  columns=['trade_date', 'symbol'])

# create random prie
np.random.seed(42)  # set random seeds
for symbol in symbols:
    start_price = np.random.uniform(100, 500)  # random initial price
    prices = np.random.normal(loc=start_price, scale=start_price*0.01, size=len(dates))
    prices = np.maximum(prices, 0)  # non-negative price
    df.loc[df['symbol'] == symbol, 'price'] = np.round(prices, 2)

# order
df = df.sort_values(['trade_date', 'symbol']).reset_index(drop=True)


# chart with lets-plot

def chart_with_lp(df):

    p = lp.ggplot(df, lp.aes(x='trade_date', y='price', color='symbol')) \
        + lp.geom_line() \
        + lp.ggtitle('Price')

    return p.to_html(iframe=True)

# show in marimo
fig = chart_with_lp(df)
mo.Html(fig)

@signup2k
Copy link

If the mo.Html(fig) still not work. (whichi shows nothing but a blank white canvas.)

You might need to check the browser with marimo running, whether it correctly load lets-plot.min.js

@VivaldoMendes
Copy link
Author

@signup2k , thank you very much for your help. It works very well.

Sorry for bothering you again, but how do I import the function ggsave to save a plot? I checked the docs, and they suggest that the use of this function would be immediate. I followed the code there, tried to save a plot, and I got this error:

NameError: name 'ggsave' is not defined

Thanks again.

@signup2k
Copy link

@VivaldoMendes

Since, we import lets_plot as lp (because, marimo does not support from lets_plot import *, you shoud add lp. before ggsave (any call from lets_plot, should add lp..

Try lp.ggsave()

@VivaldoMendes
Copy link
Author

Thanks for helping. I had tried lp.ggsave() before, but it did not work. Maybe I am forgetting something easy, but following the docs: lp.ggsave(fig, 'plot.pdf', w=8, h=4, unit='in', dpi=300),

I got the error:

raise ValueError("PlotSpec, SupPlotsSpec or GGBunch expected but was: {}".format(type(plot)))
ValueError: PlotSpec, SupPlotsSpec or GGBunch expected but was: <class 'str'>

@alshan
Copy link
Collaborator

alshan commented Aug 19, 2024

@VivaldoMendes
In the example code above, the fig variable is a Python string after p.to_html(iframe=True).
Whereas the 1st parameter in ggsave() should be p (again, in terms of the example above).

@VivaldoMendes
Copy link
Author

I'm sorry, but I'm a little bit lost. The code above produces the plot; it is visible in marimo. But to save the plot as a pdf, if p is defined inside the function chart_with_lp(), how can I call it outside that function by using that simple lp.ggsave()?

Thanks for the feedback.

a

@alshan
Copy link
Collaborator

alshan commented Aug 20, 2024

You need to modify this code. For example, let chart_with_lp(df) return p and add show_lp_in_marimo(p) function where you can do

mo.Html(p.to_html(iframe=True))

@VivaldoMendes
Copy link
Author

Hi @alshan and @signup2k, I now know what my problem was: I did not have the CairoSVG library on my Python installation. I had Kaleido and could export any format (pdf, SVG, png) when using other plotting packages. So, I could not figure out that I needed this particular package.

With the most recent marimo version (0.8.2), when I tried to save a plot produced by lets-plot as a PDF file, marimo spit out the following alert:

To export Lets-Plot figure to a PNG or PDF file please install CairoSVG libraryto your Python environment.
CairoSVG is free and distributed under the LGPL-3.0 license.
For more details visit: https://cairosvg.org/documentation/

Problem is solved. Thanks for helping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants