Git Product home page Git Product logo

cdsp-scpo / dataverse-feed Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 233 KB

Embed a feed of your Dataverse items (collections, datasets, files) in your webpage using the Dataverse search API. JavaScript module built with Svelte and Snowpack.

License: GNU General Public License v3.0

HTML 77.61% JavaScript 9.58% Svelte 12.81%
rdm repository research data javascript dataverse integration api svelte

dataverse-feed's Introduction

Dataverse Feed: (PROTOTYPE)

Embed a feed of your Dataverse items (collections, datasets, files) in your webpage using the Dataverse search API.

Dataverse Feed is a JavaScript module built with Svelte and Snowpack.

Goal

Create a simple customizable widget that can be seamlessly integrated to any website. This widget should adapt to the needs of the webpage feature-wise while respecting the design language.

Main features:

  • Seamless integration of Dataverse's search engine to a page
  • Displays or hides facets
  • Granular query support, to fectch - the latest uploaded datasets in a collection - any compound search, combining Dataverse collections, metadata values and boolean operators (dvName:cdsp AND title:COVID)

Demo

A demo is available here: https://cdsp-scpo.github.io/dataverse-feed/build.

Use case examples

Getting started

Download the JavaScript file in build/dist and add the following snippet to the <head> of your webpage:

<script type="module" defer>
    import createFeed from "/PATH_TO_JS";
    createFeed(
        document.getElementById('ELEMENT_ID'),
        {
            domain: "DATAVERSE_URL",
            params: {},
        },
    );
</script>

Default values for params:

const defaultParams = {
    sort: "date",
    order: "desc",
    type: "dataset",
    per_page: 10,
    show_facets: false,
}

The full list of parameters are here: https://guides.dataverse.org/en/latest/api/search.html.

We currently use Bootstrap 5, so you might want to add the CSS to your page: https://getbootstrap.com/docs/5.0/getting-started/introduction.

Build and Development

Clone the repo...

Install the dependencies:

npm install

To start the server:

npm run start

To build the module:

npm run build

Improvement ideas

  • support for other search API parameters/values
  • remove bootstrap
    • simplify template markup
    • add an optional simple CSS with customization options
  • support for older browser
  • allow to specify a query and hide the search field
  • enable/disable autoloading
  • add a button to go to Dataverse advanced search page
  • add a link to the Dataverse instance
  • create npm package
  • improve code/components organization
  • multilingual

dataverse-feed's People

Contributors

bappun avatar gmi-cdsp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.