Google maps and Umbraco: Many markers? - performance

I am creating a Google Map in a Umbraco solution. I have around 1000 markers to be displayed on the map, and all data for the markers are stored as individual nodes in Umbraco. What is the best way, performance wise, to pull out and display all these markers? It should also be possible to segment on the markers shown, ie., different categories etc.

You should look at retrieving the nodes with an XSLT or Razor macro, and transforming the list of details (lat/long etc.) into a Javascript array, which you then pass to the Google Maps Javascript constructor. Darren Ferguson, the creator of the Google Maps datatype for Umbraco, has a great blog post demonstrating how to achieve this with a single marker, which could be easily adapted for multiple markers.

Related

Does CKEditor 5 support storage in a layout-agnostic format?

I'm on a project that uses CKEditor 4, and we're finding we have a need to change to an editor that stores its model data as a display-agnostic format. That is to say, I want to store the documents being created in a NON-HTML format, so that we're not subject to all the vagueries that HTML WYSIWYG editors come with.
Basically, we want to limit the document structure so that users can't create documents with very deep, difficult-to-parse/traverse HTML hierarchies, but produce simple documents where we control what's in them, and there's no possibility for "bad" HTML to get into them.
I know this can be accomplished somewhat with CKEditor 4, but even so, CKEditor 4 stores its documents as HTML. I would like something along the lines of what Google Docs seems to do - displays in HTML/JavaScript/CSS, etc. but works off a model that's not tied to these technologies.
Reading about CKEditor 5's model/view separation and transformations, it would seem like this is possible. However, creating transformations that suit us would be a huge project, so I'm wondering if there are already out there CKEditor plugins or other config options that would do what I need.
I'm just starting to search for an editor that does what I want, and CKEditor 5 was my first thought.

How to create dynamic graphs in Mediawiki

Our company has an internal wiki powered by MediaWiki. We are planning to create a wiki page to post some operational data in the form of graphs. Im wondering is it possible to create the following in the wiki page?
Create combo boxes like frequency of data (last month/last quarter)
Create button to generate graph
If possible a calendar to select data range
A dynamically generated graph based on the above filters
Does wiki pages allow creation of these objects and generation of graphs based on the filters dynamically? Any references to do this is highly appreciated.
You can do this with a custom-built extension. See Extension: Wiretap as an example (the source code is on GitHub). Basically you query the database using PHP and add it into the HTML source. Then you can use JavaScript to plot with d3.
(Nearly) Interactive graphs are possible with MediaWiki, but only, if you install the Graph extension, which is a bit more difficult to work with. However, there are some good tutorials and demos on the linked extension page and subpages. I'm not quite sure, if all of your use cases can be implemented with the graphs extension, as I'm not that familiar with this extension.

Need clarifications on adding regions dynamically in Marionette

I have an application where I need to display metrics. The application needs to display a separate vertical section for each metric. When I started this, there were only 5 metrics so I naively created a template with 5 regions, one for each metric I needed to display. Now, new metrics need to be added and I want to avoid adding "hardcoded" region divs in the template. I want to refactor this and create the required regions dynamically at startup time based on some configuration data.
So I have been looking at the latest Marionette release and in question "Dynamically add regions to Marionette layout", Derick Bailey mentions that Marionette v1.0 supports dynamic regions in Layouts through addRegion(), as in:
var layout = new MyLayout();
layout.render()
layout.addRegion("someRegion", "#some-element");
layout.someRegion.show(new MyView());
I have tried that in my code (using Marionette 1.0.2) and I am not getting it to work. I don't have a div with id="some-element" in my template and I suspect this could be the reason. I was hoping that Marionette would create that div itself.
Perhaps my expectation of what dynamically adding a region means is wrong. So my first question is: when adding regions dynamically to a layout, must the element id passed in the addRegion() function already exist in the layout?
If so, then I am back to the problem of having to "burn" in the template those divs for the regions to attach themselves too. My follow-up question is then: What is the best way of doing this in a data-driven fashion? Is it a matter of writing my own render() function so that the right set of divs get created? Or perhaps providing my Layout with a model object that will contain data which the template can then iterate through to create the necessary divs? How do we add regions dynamically to a Layout object if we don't know in advance how many regions we will actually need?
Aa #aaronfay specified, we need to use jQuery to create the element on the page. Here is some sample code:
var layout = new MyLayout();
layout.render()
var regionName = "dynamicRegion";
layout.$el.append('<div id="'+regionName+'"></div>');
layout.addRegion("someRegion", "#"+regionName);
layout.someRegion.show(new MyView());
I believe you would need to use jQuery (or similar) to create the element on the page. A Region expects the element to exist.
Otherwise, I believe your answer is here.

How to slideshow through multiple jpegs/png

This is follow up question to this question: mclapply vs for loops for plotting: speed and scalability focus
If I have a bunch of images in the pattern "n_mu_stdev.jpeg", as given in Chase's solution to the above question, is there an R based method that allows some sort of slideshow with a slider according to the parameter values? From the packages that I have looked at most of the image readers tend read in the image as a data file and then re-plot it rather than just displaying a raw image, thus slowing it down dramatically...
I am not amazingly familiar with JavaScript, CSS or jQuery so if that is the proposed solution, then would probably need a step by step guide in terms of what to install etc.
one other solution i had considered was potentially uploading all individual images upon generation to a photo-sharing site like flickr or imgur (e.g kinda like in knitr), keeping note of the urls and then all the sliders do is choose which row of a dataframe to look at, which provides the correct url from which to get and display the image?...
use jquery
Read the documentations
jquery library: http://jquery.com/
jquery slideshow plugin: http://www.twospy.com/galleriffic/

Spring Views - Combining elements into views

Currently, in our deployment we have a abstract type Component which represents a part of our Page, basically an element such as a Question, which can have multiple choice, a text box or any other form of answering it, or a Video that users can play, basically a shard of a page that is interchangeable, basically, our design was to have a specific area in our website which would be rendered through a list of Components, we tried at first to have each "Page" object have a List of Components, and each Component would have a method render that would return a Spring View, we thought we could iterate over the list and somehow mash the views together.
We also tried using XSTLViews with no more success, it seems to be more of a design problem and our abuse of the way Spring MVC should be used.
We will really be glad to receive any advice/tips/corrections about how to do it right and maybe some corrections about misconceptions we might have.
It sounds like you're more than half way to a design that uses AJAX to build your page. You're trying to mash up a bunch of Components into one request. What if you returned a container page which then requested/inserted a block of html for each URL it was given a render time. Each of these URLs would refer to a single component. It might be a performance hit if you are including a lot of these Components, but it seems to fit the design.

Resources