There’s now Pie in the sky with MLJS…

I’ve added Pie chart rendering support to MLJS. I’ve made a few other recent changes. Nearing the 0.8 release and I wanted to update you in what to expect when it’s available this week…

As I’ve previously mentioned I’ve had support for Line, area, stacked area, column, stacked column, bar and stacked bar charts for a while. I’ve recently added pie charts to that mix, as you can see from the below.


What I’ve also done is close an anomaly between my widgets and those in the MarkLogic OOTB Visualisation Widgets. These Vis Widgets run each chart from a single series based on a single facet, whereas my charts run on any values within the documents returned from a search result.

What’s the difference? Using facets you receive total statistics for all documents that match a search whilst viewing the snippets or results for just the first page. This results in less traffic over the network. In MLJS up to now charts were driven by fetching the whole documents for all search results and parsing them to find matching data.

MLJS’ approach had the advantage of not needing range indexes configured for all fields in charts, but it does require more bandwidth and client side processing, so probably isn’t ideal for a production application.

I’m happy to announce that you now have the choice to run a series off of a single facet, just like the OOTB Vis widgets. In the future I hope to add support for multi axes and multiple facets sharing the same chart axis.

Search widget enhancements

I’ve also added a searchcontext object to handle updates across a range of widgets when executing a search. This means no widget need directly communicate with another widget – they are just registered with a search context instance instead. Much easier to code and maintain, not to mention debug!

I’ve also fixed the search sort and typed query parsing issues that made the previous search bar widget appear buggy. I’ve also added default rendering support for snippets, XHTML docs, any XML, any JSON and plain text documents, including thumbnail rendering for SVG documents! You should be able to stand up a new MLJS application and have readable search results snippets without any special rendering configuration.

You can also add your own custom rendering support. Please see the search results rendering tutorial for details on that.

Node.js improvements

This searchcontext object has also been moved in to core MLJS so that Node.js applications can use the same feature. Anything non GUI specific has also been migrated to Core. This includes the options builder and query builder so that you don’t have to learn MarkLogic’s JSON query and search format – just create an object and call easy to learn methods. It even automatically creates sort order configurations when you add a range index. This makes getting a search app built very easy.

Have a read of the MLJS core API for a list of these methods (some are undocumented, and will appear in the API docs in the coming days!)

Samples app

I’ve also rejigged the samples app so that it will install using Roxy on MarkLogic 6 and MarkLogic 7. This also now creates all range indexes and adds sample documents itself. This means you just run the roxy install, hit a browser URL, and the samples are ready to view!

To get started with this app, read the samples app tutorial.

The 0.8 release

All these features, and many more, are available now. I have a couple of bugs to fix and then I’ll be announcing this as the 0.8 release. This will be a code stable release meaning any changes from now on will occur in a separate dev branch. Up until now the code has been alpha quality meaning there wasn’t much point in a dev branch.

I now feel though that the time is right to limit releases to the target two monthly schedule. Once this dev cycle is complete I’ll perform full regression testing on both the Node.js and Browser versions and ensure any bugs are fixed before pushing a version out to GitHub’s master branch or to NPM for Node.js users.

This will give you the confidence that an update will work and not require a large amount of retesting yourself before taking advantage of any new features.

This release will be a large one! It incorporates many new developments and testing since the MarkLogic World 0.6 version. Have a look at the planning document for a list of features and fixes already available for download.

Watch this blog for the final release announcement some time this week.

One comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.