Giter Club home page Giter Club logo

wp-sgv's Introduction

WP Sgv

Sgvizlerを使用してSPARQLクエリの結果をビジュアライズするためのWordPressプラグインです。

利用方法

以下のように囲み型ショートコードを記述します。 SPARQLクエリは囲みの中に記述します。

[wp_sgv endpoint="http://ja.dbpedia.org/sparql" chart="google.visualization.BarChart" options="chartArea:{left:'100'},title:'The number of cities per prefecture',titleTextStyle:{color:'red', fontSize:'20'},legend:{position:'none'},hAxis:{gridlines:{color:'red'}}" output="json" height="600" width="600"]
  SELECT DISTINCT ?kenmei, COUNT(?shi) AS ?cities WHERE {
    ?ken rdf:type schema:AdministrativeArea ;
    dbpedia-owl:country dbpedia-ja:日本 ;
    prop-ja:name ?kenmei .
    ?shi rdf:type dbpedia-owl:City ;
    dbpedia-owl:location ?ken . }
  GROUP BY ?kenmei
  ORDER BY DESC(?cities)
  LIMIT 10
[/wp_sgv]

ショートコードの属性は以下のとおりです。

属性 説明
endpoint SPARQLエンドポイントを指定します。
chart チャートの種類を指定します。
options チャートのオプションを指定します。有効なJavaScriptコードとして記述する必要があります。
height チャート描画領域の高さを指定します。
width チャート描画領域の幅を指定します。
output 出力形式を指定(json/jsonp)

プラグインをインストールすると、投稿や固定ページの編集画面に以下のようなメタボックスが追加され、メタボックス内でショートコードを生成することができます。

メタボックス

生成されたショートコードを編集画面にコピペして使用します。

エンドポイントはプラグインの設定画面で追加することができます。

プラグインの設定

インストール方法

ZIPファイルをダウンロードし、解凍してできたwp-sgvフォルダを、WordPressのインストール先のwp-content/pluginsの中にコピーします。WordPressのプラグイン管理ページにWP Sgvプラグインが登録されますので、「有効化」します。

wp-sgv's People

Contributors

uedayou avatar

Stargazers

Hidetaka Okamoto 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.