EzDevInfo.com

facets

Ruby Facets Ruby Facets ruby facets is a large collection of libraries for the ruby programming lanaguage.

Project facet Java version 1.7 is not supported

When i update my java I found the issue "Project facet Java version 1.7 is not supported" To resolve this issue follow the steps.

  1. Go to Ecllipse , right click on your project folder
  2. select the properties
  3. now select Project Facets ,here you will see java, click on the version and change the higher version to lower or as per your requirement .

enter image description here


Source: (StackOverflow)

How can I move facet labels to top of my graph?

I can create a faceted plot like so, with 3 plots stacked vertically:

ggplot(iris, aes(Petal.Length)) + stat_bin() + facet_grid(Species ~ .)

Is it possible to move the labels to the top of each graph, like they would be if I'd done horizontal stacking with facet_grid(. ~ Species)?

The reason I want this is that my plots are long time series plots, so I want the full width for each one, but the labels (which essentially function as titles to explain the facets) for each plot are too long to fit in the small label area at the right of the plot.


Source: (StackOverflow)

Advertisements

Varying axis labels formatter per facet in ggplot/R

I have a dataframe capturing several measures over time that I would like to visualize a 3x1 facet. However, each measure contains different units/scales that would benefit from custom transformations and labeling schemes.

So, my question is: If the units and scales are different across different facets, how can I specify a custom formatter or transformation (i.e., log10) to a particular axis within a facet?

For example, let's say I have the data:

df = data.frame(dollars=10^rlnorm(50,0,1), counts=rpois(50, 100))
melted.df = melt(df, measure.var=c("dollars", "counts"))

How would one go upon setting up a 2x1 facet showing dollars and counts over the index with labels=dollars and scale_y_continuous(trans = "log10", ...) for the df$dollars data?

Thank you!


Source: (StackOverflow)

Colouring points by factor within the margin of a faceted ggplot2 plot in R

I'd like to create a faceted plot with margins in ggplot2. However, I'd like the margin plot to have colours according to from which facet the particular point has been derived. It's probably best illustrated with an example:

library(ggplot2)

p <- ggplot(mtcars, aes(mpg, wt)) + geom_point()
p + facet_grid(.~gear, margins = TRUE)

Within the margin plot labelled as "(all)", I want those dots that have "gear = 3" to be plotted with one colour, those with "gear = 4" with a second colour, and those with "gear = 5" with a third one.

This one doesn't do the job:

p <- ggplot(mtcars, aes(mpg, wt)) + geom_point(aes(col=gear))
p + facet_grid(.~gear, margins = TRUE)

Is there a way to achieve what I want?


Source: (StackOverflow)

correlation values in a facet grid from ggplot2

When using a facet_grid in ggplot2 I would like to be able to have value of the correlation for the subsetted data for each grid cell in the top right corner of the specific plot.

e.g. if running:

p <- ggplot(mtcars, aes(mpg, wt)) + geom_point()
p + facet_grid(vs ~ am, margins=TRUE)

I would like to see the value for correlation for each of the 9 plots in the grid somewhere. In this specific case from the example, I would expect each to be close to -0.9 or so from visual inspection.

Or perhaps an output table to go with the plot that gives the correlation values for each of the cells in the table matching up with the facet_grid...(this is less desirable but also an option).

Ideally I would like to extend this to any other function I choose that so that it can use either or both of the two variables plotted to calculate statistics.

Is this possible?

Thanks in advance


Source: (StackOverflow)

How to make pretty ordered facet labels for numeric values?

I often facet according to a numeric variable, but I want the facet label to be more explanatory than the simple number. I usually create a new label variable that has the numeric value pasted to explanatory text. However, when values have more than one place before the decimal, the first number is used for sorting the factor. Any suggestions to avoid this?

iris[,1:4]<-iris[,1:4]*10

This would work fine for iris, when it does not have more than one value before the decimal.

iris$Petal.Width.label<-paste("Petal.Width=", iris$Petal.Width)



iris$Petal.Width.label<-paste("Petal.Width=", iris$Petal.Width)


qplot(data=iris,
      x=Sepal.Length,
      y=Sepal.Width,
      colour=Species)+facet_wrap(~Petal.Width.label)

Plot with miss ordered facets

Related to:
ggplot: How to change facet labels?
How to change the order of facet labels in ggplot (custom facet wrap labels)


Source: (StackOverflow)

Translating ElasticSearch Facets Query into PyES

I have a following query and I want to change that query into PyES:



    {
      "facets": {
        "participating-org.name": {
          "terms": {
            "field": "participating-org.name"
          },
          "nested": "participating-org"
        }
      }
    }


I have searched in PyES documentation about:

class pyes.facets.TermsFacetFilter(field=None, values=None, _name=None, execution=None, **kwargs)

And I don't know how to use it plus I couldn't find any examples related to it. Hoping to see PyES guys coming out with good documentation with examples in future.


Source: (StackOverflow)

Can't add Java Project nature to nested m2Eclipse project

I have a nested m2Eclipse project in Indigo. The parent project contains the src folder that is used by the nested modules (see structure below).

  • parent
    • src
    • pom.xml
    • module1
      • pom.xml
    • module2
      • pom.xml

Running mvn package from the Maven run configurations builds all the modules, so dependency management appears to be working. However, I don't have a MAVEN DEPENDENCIES folder and I can't use Java content-assistance or any other Java Project capabilities on any of the source files. I tried converting the project to faceted form and adding the java facet, and that didn't work either.


Source: (StackOverflow)

Eclipse and Facets

In the courses java, everyone (or at least most people) seemed to have a working eclipse. They always seemed to have a working faces-config (a visual one), and autocomplete in xhtml files (for facelets). Though for autocomplete, we added *.xhtml files on JSP's.

It seems that this was a part I don't know well about eclipse, and it's fairly annoying since I don't know why. When I import a project (either Maven or existing), it always has no facets but java (and that in 1.5 not even 1.6), while it is supposed to be a webproject and have facelets & dynamic web project.

Can I change those facets? It seems to just work when I put java to 1.6, but trying to edit the dynamic web module version from 2.4 to 2.5 (it is standard on 2.4) without running into some troubles. Even after I just made a fresh maven project (with an archtype in commandline), I'm not able to change much about these facets.

What am I doing wrong?


Source: (StackOverflow)

How do I make my facets perfectly square?

I'm using facet_wrap with ggplot to create a plot of facets. My problem is that my facets always come out looking like very short, very wide rectangles, but I want them to be square so they are easier to understand. Ideally, I would like to specify the number of columns I desire, and have ggplot figure out what the height of the plot should be so that all the facets are square. Is this possible?


Source: (StackOverflow)

Sunspot: facets on location

I know it's possible to do stuff like that:

bod = Time.zone.now.beginning_of_day
facet :start_time do
    row :past do
        with(:from).less_than bod - 1.day
    end
    row :today do
        with :from, bod
    end
end

So I tried to add facets on the location like this:

with(:coordinates).near(coord[0], coord[1], :precision => 3)
facet :distance do
    row 2 do
        with(:coordinates).near(coord[0], coord[1], :precision => 2)
    end
    row 3 do
        with(:coordinates).near(coord[0], coord[1], :precision => 3)
    end
end

But I get the following error: undefined method near for #<Sunspot::DSL::Restriction:[...]>. Why is it not a Sunspot::DSL::RestrictionWithNear?

If you got facets with locations working, please, help me ;)

Thanks


Source: (StackOverflow)

ElasticSearch grouping facets

I have document with such structure:

{
    id: 312256,
    name: "SomeName",
    filterBlocks: [{
            id: 0
            filterTypeId: 4
            filterItems: [
                1190
            ]
        }, {
            id: 0
            filterTypeId: 3
            filterItems: [
                353
            ]
        }, {
            id: 234
            filterTypeId: 1
            filterItems: [
                6342
            ]
        }
    ]
}

For each distinct combination of filterBlocks.id+filterBlocks.filterTypeId I need N size facets on filterItems field. I try to use query like:

{
    "query": {
        "match_all": {}
    },
    "facets": {
        "filterBlocks": {
            "terms": {
                "field": "filterBlocks.filterItems"
            }
        }
    }
}

But of course I get only N facets without grouping by filterBlocks.id+filterBlocks.filterTypeId

What' I need modify in my query or document structure to get it right? Thank's


Source: (StackOverflow)

Is there any meaningful performance difference between integer and string values for solr facets?

We're adding a facet field to our solr document set that defines which group it belongs to - the data comes out of mysql and I have a choice of putting the integer id (mysql pk) in the facet value in solr or putting the shortname (mysql varchar(32)) in the facet value.

Using the shortname has some appeal because we can go from user input (the shortname will be part of a url) straight to a solr query without a trip to mysql to find the pk.

However before I go that route I'd like to know if faceting on string fields is significantly different from faceting on integer values from a performance standpoint.


Source: (StackOverflow)

Faceting on distance in solr- how to generate links that search withing a given range of distance

It is fairly simple to generate facets for ranges or 'buckets' of distance in Solr: http://wiki.apache.org/solr/SpatialSearch#How_to_facet_by_distance

What isnt described is how to generate the links for these facets

If this is the query to return everything within 5km :

&q=:&fq={!geofilt sfield=store}&pt=45.15,-93.85&d=5

-what then would be the syntax to search for everything between 5 and 10km ?

Basically I can generate distance facets, but I dont know how to generate the links for the distance facets:

for example, what would the links for the following facets look like?:

distance

0-1km (2)

1-5km (0)

5-20km (0)

20-50km (0)

50-100km (0)

100-250km (0)


Source: (StackOverflow)

Maven vs. Eclipse Project Facets for Java EE 6

I have created Maven projects inside Eclipse with these archetypes:

  • ejb-javaee6
  • webapp-javaee6

The projects were created without facets.

Does it make sense to convert such Maven projects into faceted form?

Which facets would be helpful and which ones could cause trouble for a Maven project?

Specifically: Would any of the following project facets be in conflict with something that is in the responsibility of Maven?

  • Java
  • JavaScript
  • EJB Module
  • Dynamic Web Module
  • GlassFish Deployment Descriptors Files
  • JavaServer Faces

I have the impression that converting a Maven project to faceted form would mean mixing two worlds. Therefore I tend to NOT enable ANY project facets.

But where I work we have examples of Maven projects that are in faceted form and I was wondering whether there might be (risk-free) benefits to it.


Source: (StackOverflow)