Giter Club home page Giter Club logo

tidystats-google-docs-add-in's Introduction

tidystats Google Docs add-in.

This software is an add-in for Google Docs to insert statistics from a file created with the tidystats R package. For more information about tidystats, please visit the tidystats website.

This Google Docs add-in is written in Google Apps Script (Google's Javascript-based development platform for building applications and add-ons for Google Sheets, Docs, Forms and other Google Apps), built on the boilerplate project available via https://github.com/enuchi/React-Google-Apps-Script (which can be consulted for details about the code structure).

Installation

Later on, the add-in is to be published and available among the official Google add-ins for easy installation. For now, it can only be installed "manually", as follows.

1. Make sure you are running at least Node.js v10 and npm v6.

2. You need to enable the Google Apps Script API. You can do that via script.google.com/home/usersettings.

3. Clone the repo and install the dependencies.

git clone https://github.com/gasparl/tidystats-Google-Docs-add-in.git
cd React-Google-Apps-Script
npm install

4. Next, you need to log in to clasp that allows managing Google Apps Script projects locally.

npm run login

5. Update the .clasp.json file in the root of this project with the following three key/value pairs:

{
  "scriptId": "1PY037hPcy................................................",
  "parentId": ["1Df30......................................."],
  "rootDir": "./dist"
}
  • scriptId: Your existing script project's scriptId. You can find it by opening your document, selecting Tools -> Script editor from the menubar, then File -> Project properties, and it will be listed as "Script ID".

  • parentId: An array with a single string, the ID of the parent file (Google Document) that the script project is bound to. You can get this ID from the url, where the format is usually https://docs.google.com/document/d/{id}/edit. This allows you to run npm run open and open your file directly from the command line.

  • rootDir: This should always remain "./dist", the local build folder that is used to store project files.

Now you can run the deploy command to compile and upload the scripts to the specified Google Document. (You may be prompted for confirmation to update your manifest file; select "yes".)

npm run deploy

The deploy command will build all necessary files using production settings, including all server code (Google Apps Script code), client code (React bundle), and config files. All bundled files will be saved to the dist/ folder, and then pushed to the Google Apps Script project.

Now you can open or refresh the Google Document and you should see the new menu "tidystats". (You can also run npm run open to open the document.) You can also see the uploaded Google Apps Scripts via Tools -> Script editor.

Support

Found a bug or got an idea about how to improve the add-in? Please create a Github issue. If you need some help figuring out how this works, see this support page by Github or simply contact Willem Sleegers on Twitter or via e-mail.

tidystats-google-docs-add-in's People

Contributors

gasparl avatar enuchi avatar dependabot[bot] avatar piavgh avatar johnnyslots avatar ganapativs avatar nikola3244 avatar realslimmahdi avatar rcrj avatar

Stargazers

BKleinberg avatar Willem Sleegers avatar

Watchers

Willem Sleegers avatar BKleinberg avatar  avatar

tidystats-google-docs-add-in's Issues

Add icon to tidystats menu item

We should add an icon (if possible) to the Insert statistics menu item. Now it looks weird with so much white space on the left.

Find alternative ways to tag and update inserted statistics

The current solution that inserts statistics as links works (yay), but has some limitations:

  1. The numbers have a different color compared to the main text (probably easily fixable)
  2. Hovering on them reveals a partial link, which is distracting because it's not useful, and the link just takes you to the website, which is also not useful

I wonder what alternative methods are possible and if some of them are potentially better (and less hacky).

Give the add-in more of a Google feel

We should list somewhere what the styles should be for the Google add-in and for the Word add-in, and then figure out the easiest way for them to share the same codebase but with different styles applied to each add-in.

Test analyses that have 3+ group levels

Because the sidebar in a Google add-in is fixed at 300px, this might be an issue for analyses that have many groups within groups. We should test what that looks like and figure out a way to work with that limit.

Removing the larger icon/title part of the sidebar

The large part at the top of the sidebar with the tidystats icon could perhaps simply be removed to give more space to the functionalities and other important info (such as the uploaded statistics).

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.