I have a question regarding how to apply colours and layout to all the apps in shiny.
I have all my apps saved here:
/srv/shiny-server/all_apps/
And I have three apps:
/srv/shiny-server/all_apps/app_1/
/srv/shiny-server/all_apps/app_2/
/srv/shiny-server/all_apps/app_3/
I know that if I need to include a CSS file for the app_1, I need to create inside app_1 a www folder and save the CSS file inside.
But I don't know where I need to save the CSS/HTML files to create a nice interface where the user can select the app that they want. Right now if I go to the following page:
/srv/shiny-server/all_apps/
I have an ugly first page to select one of the three apps (see below).
Index of /all_apps/
app_1/
app_2/
app_3/
Could anyone help?
Thanks,
Julen
Then you just need to save HTML/CSS files for a start page in /srv/shiny-server/all_apps :)
It's important to name the HTML file "index.html", otherwise it won't work.
Related
I'm looking for some advice for adding d3.js charts to Wordpress.
My client has commissioned a forceSimulation - still in progress. It is currently organised as follows:
index.html
main_javascript.js
main_css.css
global_properties.js
data_file.csv
I'm totally clueless as to whether it is possible to add the chart to her Wordpress blog and if so how to do it.... Any advice would be much appreciated.
Many thanks.
For reference, here are the WordPress docs on Using JavaScript.
Making it easy for them
From past experience (though not in WordPress), I'd try to simplify the steps your client has to take to get the visualisation working well, just in case the person doing them has little technical skill.
Hence, as far as possible, I'd combine your files into one force-viz.js:
CSS rules can be inlined by using d3.style in JS on the appropriate elements.
CSV can be inlined as a JavaScript string, parsed with d3.csvParse.
global_properties.js can just be in the same JS file.
index.html is unnecessary if you use d3.select(...).append(...) to construct the DOM tree you want, and instruct your client to write—
<div id="force-viz"></div>
—where they want the chart to appear, then d3.select that in your script.
This would mean all your client has to do is:
Place force-viz.js in a scripts/ directory.
Paste—
<div id="force-viz"></div>
<script src="scripts/force-viz.js"></script>
—into the text of any page, wherever they want the chart to appear.
Making it easy for you
If being forced to program into a single file is annoying, I recommend Browserify. It's a tool that can process a set of JavaScript files with require('whatever.js')-calls to each other, combining them appropriately into one file. With a plugin, it can even turn fs.readSync('data.csv') calls into strings containing that file's contents, which you could use with that CSV file.
That way, you could continue programming the thing as separate files, then run browserify to bundle them up for your client.
Or just do it manually, if this is a one-off project. Your call.
I have an image i'd like to embed into my shiny app, and have read as much as I can find on how to do it. Although, all I get is a blue question mark when I run my code.
This is the line of code I have added, within the fluidPage ui command
img(src="logo.png", align = "right",height='100px',width='400px')
My image has been placed in the project directory folder, as well as trying in a separate folder inside named www (as per suggestion given here)
EDIT: Code used in the following context:
ui <- fluidPage(titlePanel("Test title"),
img(src="logo.png", align = "right",height='100px',width='400px'),
hr())
After coming back to this problem, I found that the solution is to simply format the Shiny code properly, by naming the R file app.R, and clicking Run App as opposed to selecting all of the code and running within the console.
Not sure how or why this makes a difference, but the numerous Shiny applications I have worked on since have all been resolved when doing this.
Just a note that may be helpful to someone else, it just happened to me: please double check if your app.R is in the root directory. I.e, app.R is on the same level as the www folder. I know it seems trivial, but if you (as I just did) put app.R into a subfolder and click Run App, the app can still run, just without the pictures.
I was having the same problem. To solve this, just create a folder named 'www' in the same folder as your app.R script and put the images within that folder.
I found the solution to this problem in the tutorial video in this page: Shiny Tutorial Video - Adding Static Content
Watch from 1h45min00sec.
You should check if the name of your R code file is called “app.R" instead of called xxx.R. this error also happened to me
I'm working on Magento modules.
After few guides I managed to create module that says "hellow world".
Also I have made some of css code that add simple image border around whole page.
So the problem is: how to combine them together?
I want that when I install my module, image border appears around page.
What should I be looking for? Any tips? I need right path to look for answers
T.y.
You need to to
Create a module
That modifies the global layout such that your CSS is added to the page
Re: number two, there's multiple ways to go about doing this. These days I favor the event/observer method
Add an observer for the controller_action_layout_generate_blocks_after event
Fetch the head block from the layout in your observer method
If you find a head block, add your CSS file to it programtically
The more traditional way is
Configure you module to include an additional layout update XML file
In the default handle of your new layout update XML file, add XML that tells Magento to add your CSS file
That should give you enough to google on and come back with more specific questions. Good luck!
I am beginner in asp.net development. I am creating an web application where I am required to show images from folder along with folder name. Such that one list containing folder names when one folder name is selected its file names are displayed (images names) and also in image viewer images are displayed one by one on button click. then so on for next folders.
Any suggestion, code or useful link will be highly appreciated.
Thanks in advance.
Here is what you want
You can use Jquery tree view with Asp.net
http://www.programmingsolution.net/useful-js/jquery-treeview.php
For jquery try this
http://jquery.bassistance.de/treeview/demo/
Check this ready to use control with lesser effort I suppose. http://www.obout.com/Obout.Ajax.UI/FileManager/
I am pretty new to Sharepoint.
I need to customize some Sharepoint Masterpages (the background color, the font type and a few other css requeriments).
Considering I have available the following files: v4.master, default.master and two more pages which are content pages of default.master, plus the COREv4.css file.
I know I should create a copy of one of those master pages (I am not sure which tho) and customize it changing the CSS linked to it). The following questions come in regards of this:
1) The custom CSS file should be a modified copy of the COREv4.CSS or just another CSS file with the desired styles?
2) How do I create/link the customized CSS file for the modified page via Site Settings?. How/Where should I save the new file?.
3) As for the copy of v4.master, How do I load it to "replace" the original one for the site?.
4) The system is built upon Sharepoint 2010. That ensures that the page to have the modified CSS would be a v4.master copy only?.
Thank you for the insight as always.
**Update**
Hi,
I managed to solve the problem getting a general idea with the pdf manual provided, your suggestions and some extra steps I will describe briefly:
1) To place my custom css file I put it in the folder: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\3082\STYLES
2) I opened the site to be customized with Sharepoint Designer 2010.
3) I clicked on the option Main Pages/Master Pages, and selected the page to be v4.master page, copied and pasted it. Then I renamed it right clicking on it, selecting "Rename" and typed the new name, after doing that I right clicked one more and selected "Set page as main default page".
4) To edit the contents of the page I right clicked once more and selected the option "Edit content in advanced mode", right before the head tag ended I copied and pasted:
<SharePoint:CssRegistration name="customname.css" runat="server" After="core4.css"/>
Note that "customname.css" is my css file. Then I clicked on the floppy disk icon on the upper left side of the screen to save.
5) After doing that I used Chrome HTML/CSS Analyzer, inspecting the original (and now copied) master page to browse on the zones that needed customization in order to identify the class names/ids/element types that managed the styles to be changed. Once identified I only added to them the properties that required change, EG:
//Webparts Alternate Highlighted Rows
div#ctl00_MSO_ContentDiv table.ms-viewlsts tbody
tr.ms-alternatingstrong{ background-color:#F7FAF4 }
table.ms-listviewtable.ms-basictable tbody
tr.ms-alternatingstrong.ms-itmhover{ background-color:#F7FAF4 }
I mostly did this by myself by trial and error with Chrome Analyzer but I also helped the task using the Chart found here (http://sharepointexperience.com/csschart/csschart.html), tho at some point going thru it turned a bit tricky and I decided to do it by myself as I mentioned. In the process I repeatedly added more styles to the custom file and then overwrote it on the server location to refresh the page/pages to see how it was looking, this till the end of the process.
Thanks for your help, I hope this serves as a guide for anyone that needs it. If you have questions let me know.
You can create a new master page from the scratch or modify the existing one.
Please have a look at this link it may help you to get answers of your questions
http://www.rdacorp.com/wp-content/uploads/ASP-NET-Master-Pages-and-SharePoint.pdf
It's not advised to modify files of SharePoint.
Better to create new master page file, specify all CSS and script you want inside and install this with feature.
What version of SharePoint do you have? SharePoint 2010 Server or Foundation? Cause with server version you can brand your master page in a cool way:
see this link
Microsoft has a good introductory article on how you can/should do this.
http://office.microsoft.com/en-us/sharepoint-designer-help/customize-a-master-page-to-brand-your-site-HA102449505.aspx