Category: JavaScript

MapReduce in MongoDB

Using MapReduce in MongoDB:

  • What are some benefits to MapReduce vs. Aggregation Pipelines
  • Parts of the mapReduce function.
  • How to create a mapReduce job.

 

Read More

Robert Henkhaus is the Product Manager and a Developer at Ruths.ai. He has 5 years of experience in the oil and gas industry and was previously with ConocoPhillips supporting BD and Land in high value decision spaces. Robert has a BS in Geography with emphasis in Earth Science from Texas A&M University. Before completing school, he also served 8 years in the Army as a sniper.

IronPython and JavaScript to refresh data tables at a set interval

  • Are you connecting to data sources that update frequently?
  • Would you like the DXP or web player file to reload data at a set interval?
  • Would you like the DXP or web player to reload without hitting the reload button?

Read More

Guest Spotfire blogger residing in Whitefish, MT.  Working for SM Energy’s Advanced Analytics and Emerging Technology team!

Unscrambling the Spotfire Text Area

  • Are you frustrated with the Spotfire Text Area?
  • Are you just getting started with HTML, CSS, JavaScript, or jQuery?
  • Do you find all the different languages that can be implemented in Text Areas confusing?

Read More

Guest Spotfire blogger residing in Whitefish, MT.  Working for SM Energy’s Advanced Analytics and Emerging Technology team!

Setting up a Button Function

What I’m calling the ‘Button Function’ is a simple JavaScript that can be used to make a div class area “clickable” like a button. For the non-CSS savvy (like myself), it’s nice to have an example with the code snippet so if you need more explanation, be sure you understand this previous post and the post before that.

Here, I’ve added a JS to my HTML Editor and named it buttonFunction.

 custom-menu-buttonfunction

Next, I added a script parameter for buttonID using a String type and the Spotfire Control id for the action as the value. Then, I repeat these steps to make a JavaScript for each “button”.

custom-menu-js-buttonid

custom-menu-js-btnfunction

In the my HTML Editor, I also see the same value as an ID attribute value preceded by “btn” for the DIV class. The Spotfire Control Id is in a separate Div Class towards the bottom of the script and is hidden from the display.

custom-menu-html-btnfunction

custommenu-displaynone-spotfire-id

The result (from simple JS, CSS, and HTML) is a text area designed to look like a custom menu with clickable “buttons” that perform the action stored in the out-of-the-box Spotfire Control:

custom-menu

If you liked this and the previous posts, please let us know in the comments! We’d be happy to hear about your use-cases and any special design improvements that you’ve made!