Open anuveyatsu opened 4 years ago
Comment from Paul Walker:
A bit of further analysis.
Pros:
unloadDatapackage
?)I'm guessing that this should have an interface as follows:
import { unloadDatapackage } from 'data.js'
import { serializeState } from './utils'
// ... reducer code
const unloadedWidgets = getState().widgets.map(widget => {A
const newWidget = deepClone(widget)
newWidget.datapackage = unloadDatapackage(newWidget.datapackage)
return newWidget
})
// add unloaded to state, etc
Questions:
datapackage
(data attached) can we remove all data
and _values
attributes from all embedded resources and still have a valid (ie fetch-able datapackage)?Cons Complicated
Save the initial config and use it to reload app, along with controls which could be updated.
So an application could be rehydrated with two attributes and one function call:
config.WidgetsOrViews
(immutable never changes)config.Controls
(current state of application)loadData()
(go get the data)The output of this would be the application state, including data
Comment from Paul Walker:
Most of this is done:
There is a problem that the state is too long for the url which has a limit of 20000k I think that we need some sort of key/val storage which works like this:
I could do further research on redis solution. I'm sure there is a freemium hosted solution
Open to other suggestions :)
Comment from Paul Walker:
Also maybe we can use JSONC.pack which is url friendly zip... it's very ugly / unreadable / looks kind of sketchy (ie - it looks like obfuscated code which I would probably not paste into a url myself because I wouldn't trust it)
JSON:
{"widgets":[{"active":true,"name":"Map","datapackage":{"views":[{"id":0,"title":"Murales%20en%20format%20geojson","resources":["murales_en_format_geojson"],"specType":"map"}]},"loading":false}],"datapackage":{"resources":[{"path":"https://montreal.l3.ckan.io/en/dataset/587de1ea-817b-4e10-b387-83ec89f94e1b/resource/bc1e71e4-269a-4fa9-a278-ab6bfd80ec23/download/murales.geojson","pathType":"remote","name":"murales_en_format_geojson","format":"geojson","mediatype":"application/geo+json","mimetype":"application/json","cache_url":null,"hash":"","description":"Cet%20ensemble%20de%20données%20présente%20les%20murales%20financées%20par%20la%20Ville%20de%20Montréal%20depuis%202007.%20Les%20murales%20répertoriées%20sont%20celles%20financées%20par%20les%20programmes%20suivants:%20Graffitis%20et%20murales%20(2007-2015),%20Projet%20pilote%20d%27art%20mural%20(2014-2015)%20et%20Programme%20d%27art%20mural%20(2016-).\r\n\r\nVeuillez%20noter%20que%20les%20photographies%20des%20murales%20liées%20dans%20l%27ensemble%20de%20données%20ne%20sont%20pas%20soumises%20à%20la%20licence%20de%20données%20ouvertes%20Creatives%20Commons%204.0.%20Les%20œuvres%20sont%20protégées%20par%20les%20droits%20d%27auteur%20d%27usage.%20Pour%20toute%20utilisation,%20veuillez%20contacter%20les%20ayant%20droits%20afin%20d%27obtenir%20les%20licences%20nécessaires.","created":"2019-08-20T13:04:09.502529","datastore_active":false,"package_id":"587de1ea-817b-4e10-b387-83ec89f94e1b","cache_last_updated":null,"state":"active","mimetype_inner":null,"archiver":{"is_broken_printable":"Downloaded%20OK","updated":"2019-08-20T13:04:15.236769","cache_filepath":"/tmp/archive/bc/bc1e71e4-269a-4fa9-a278-ab6bfd80ec23/murales.geojson","last_success":"2019-08-20T13:04:15.236769","size":126010,"is_broken":false,"failure_count":0,"etag":"\"7575193e1c3c66dfd425bf61e5f46787\"","status":"Archived%20successfully","url_redirected_to":"https://cc-p-minio.ckan.io/ckan/montreal/resources/bc1e71e4-269a-4fa9-a278-ab6bfd80ec23/murales.geojson?AWSAccessKeyId=2effdd1004072cb9&Expires=1566306315&Signature=eKO3AI%2BGPGUaRtMApJNZ%2Fflma4M%3D","hash":"d023a02c1f1646fcaded3a8075eb4059accf1088","status_id":0,"reason":"","last_modified":"2019-08-20T13:04:10","resource_timestamp":"2019-08-20T13:04:09.461130","mimetype":"application/json","cache_url":"https://montreal.l3.ckan.io/bc/bc1e71e4-269a-4fa9-a278-ab6bfd80ec23/murales.geojson","created":"2019-08-20T13:04:15.258228","first_failure":null},"last_modified":"2019-08-20T13:04:09.440232","position":0,"revision_id":"e82aa157-d0bd-48f4-91f1-8135ba972fec","url_type":"upload","id":"bc1e71e4-269a-4fa9-a278-ab6bfd80ec23","resource_type":null,"size":null,"title":"Murales%20en%20format%20geojson","encoding":"utf-8"}],"controls":{"showChartBuilder":false,"showMapBuilder":false}},"datastoreFilters":{}}
"㞂⃮ॠ☎悦Ű㎈׀浐Ⴠ예聮熠聎ʹ쀍ࠁ\ud960ⶱꢀⲖ8荔堩홙Bᰰ⠲蚆考ർࠀ\udb33湔陵䠂适恗ᚡ蔀찃\uda90柌ﱋ¬鉝귄⤸⺴鴈̖躗耾覨喍鼨䎳ꮈ.贒ܜ➚娠月/ꉡ䴪ꖖᐄⴌᨹ躒ᰱ伟エꨨ➷꤯貦ࠇἀ֞䣂ȇሪ=ⳃ⮙ᰎ耝⪀㌪ﭖ쐥곉곯㼣䈬쀫\u0007;ᐜ#ીⴵ쀑诀ଓ슋폡뎹밶耓鳁௺㴾댞ꖇ윅驼烏害쟢Ø⅘徽䈒흒柗᧷ㅁ껆ᰁ荢璱腨苘⮥姄屮ᨰ섂㛊鹅舘荇ꄰ洮鰫䒋奬ࡘ鰉쀯煄㕹繂䚄슩ᩎܕ䄁쇰ິ妃耍伔ᘄ⁌Ѕ꼥榵\udbf0깙鮽읩삌贋䜢㐑阉ر掸Ṉᰩȁ쐍롘a䐙蓈큢緔昇땵쭀ɝ磌᱒㵱ꭆ閙瑦䕈彄朳啶㡆。䰵ⅶ끦\u001a萁㜆긮責▫杄룣造掣ʖ 撛䙞쫛䪐ზࠨ⡁饼ற譁ẟ의䧑苷ᵈ䬆ېᠦ䆷ȗ晁倳\u0007ᛑ챁\udf03㏇釼\n㷖ᑇ鋠Ĩ꠳\u0000嘃ᰌ㱷鴬仈슁迶細ꕌ엃࣬䣂⎈틍衑⢐Ⰺ憫昵觬祎㞍쑞戵怀畈䔶虓咙츆\udc17\u000b쳅ꇨ렟G䨋뇼㠑麉ጸᆒ䌝㌩⥑ﱭߑ跘읕ᦋⳠ둣霅ਃ규蔖舊齦씴粑؇燼\u0003꧋떴䱟ॵ굨ۇ蠛쟴ⴼ筈茝ୋᰍ烇ᾕ恑༣ӳᴀ敀爀臩抎\ud9b6Ȑ竆̊✋㇎Ƞ搜伤끲ᩒ탆\udb9c艀䐸Ẫኑ挶苉빱\udded圌訰衭㵃튌ᰉ旁ꕣ《삲堺똛䚣ﱦ쬓栈ይ狒꿇啕돪僘꺔ꀼ鞉␔䩈색ḍ销偾③ᕙ⸅Ä렌ࡃ㕨遛폅ৎ숙螩呆衒ဖ킞䅠湻觥秞⾗Š弎룁ᰒᚅ慏鐵쀣傕䅍㕲΅㣠ࡵΌጔ龆镽㰔齱䋕Ʝꌶ㞍ጐ툌䄀睐鏦̄ࢅ뚩썀D\ud90e䊠碘ꌀސƥ\udc49穝陀⡥ࣸ焞䝐∵晥煛鼒ៃ䣐睑蔴쐅預薘跻⢅䑰⋣ዄ煼傑黎剜钤끪嚗ꔙ晛酲逾孑ೊ煴⊂瀀爜⎡\ud861䂎醔昻踓\udc65₀瓦ᇣ씈ꔜ\uda41ⷫ擃ꠚ樄ީስ㯈໑䆡ထ༤剀宒Ḉ䰔硰ඇׅ焨ຑ\uda57ᙹߣ윻蕽\udc01㏠獏 䄾聜斣선猏겲㾵₪ᐢ砪觠딈랜扌榇ㅦ㽱砜ף씏ꥡ똰菘܌蟐薆롖⪀䑞իㄜǢᗈ酠ቆ䠩ᔡꑴ膓ꐖ膑ꖠ\u001f鈄u\f꤃ၒɀ㻎Ť\t─/ƃ耨䨁䁇股醾㠓\u0006䀁䐀އȆ䠐씑㟡뀔⸠\ud844䇆ꢈ́>蘮û⽡넠庌 ࡁРŔ뀀ɐ䂬ሄ瀀Ԡä\u0016ꆀb䋘ᾊ샴ۂ目ᤲ蔁ㆆ싀飝᎘䞋褀禃됞춤㈛㸏쁐需鏷⺓ථ⠊噳嚚쬕町曮Ӕ∬⪈㡥ꃷ뺡쑹輨\udc22♄г텸縃鳶烷จ\udc7aꍕ蠃Ḃぐ煈永㖥됻凑眐ؘ䖴戡匆揌䖁\ud98aꪇ塛ݠッ蚈硟ࠑ҈䒈\udaee⌛钊搬陇띹ᨌ嘸㖹ܾ৩煣跀〆ᙤ큁쩀㙞ߏ堦劂Å蛊\ud910ݥܐ쪎㆜젌㮀ऀ贇䩼㰜誵숬벇ƮƂ쁘ࢋ駰ꀯ울%䞅틞ȴ뢟ᡆ\udc03툺ು弣䉋乁౨ᴱh钻ꮰ覮戾롈ꛭ∶⧌⏖犃梫湐⍝䇤嘅藐ꦀᳪ軁ᡢ噼뼥芨㔏≍猆㉆ի鋀匳檘\ud921晌㞁❩ފ浐㤴꘠ֵ聶ǁ㭼寂餴湚燅떃肥㹰崙ఁਡ䈀"
JSONC compression isn't a definitive solution since we will still easily exceed the url limit in some cases - if the resource description is long, for instance
Comment from Rufus:
let's not do key value stuff in redis. For now we can see if we could keep it simple e.g. strip the data package down to essentials.
Longer terms we just store views explicitly i.e. login to store and share ... (that's a separate issue).
Moved from gitlab, originally created by @starsinmypockets
As a user I want to share a link the data explorer in the state it is currently in so I can share insight and have fun exploring data with friends
Accptance
Tasks
Analysis
(from hackmd w/ Rufus + Anuar 2019-09-02)
Data Explorer can take and run ...
view-embed?redux= .....
Boot a data explorer and load that redux ...
/core/xyz ... looking at an explorer
share https://mysite.com/view-explorer?redux=...
iframe src=/view-explorer?redux=....&embed=true
/view-explorer?redux=xxx
/view-explorer?redux=xxx
ACTIONS